0
votes
0answers
10 views

Is it better to use the systemd service unit's Restart & RestartSec, or use a systemd timer unit?

I have a couple of in-house automated scripts running at periodic intervals. One is every five minutes, the other is every minute. They don't really need to be ran on-the-dot; e.g. I don't care if ...
0
votes
1answer
78 views

ways to automatically fix line endings in shell scripts or files who break with ^M

Problem We regularly break our files lines endings and things stop working without us noticing. Bash complains about "invalid option" or ": command not found" as described here: ...
0
votes
1answer
29 views

How to get atop to create daily logfile

I'm running a website on a VPS running Centos 6.5 and am having some issues. I'm new to serveradmin so just learning. atop was already installed on our machine and it's working. I wanted to go in and ...
1
vote
1answer
94 views

Capturing output from a remotely executed command via SSH fails in CRON

This question is in a direct relation to this one: ssh fails to execute remote command when run from cron bash script - works from CLI I'm not able to comment on the accepted answer as I don't have ...
1
vote
1answer
44 views

Difference between “crontab -e” & editing crontab file manually? [duplicate]

I noticed some people use "crontab -l" to view cronjobs and "crontab -e" to edit them. However there are also times where people manually modify "/etc/crontab" to view/add/remove cronjobs. Both ...
3
votes
1answer
49 views

Crontab - Unusual config - Skip a small weekly time window

I have a business requirement to run an unorthodox crontab schedule as follows: Everyday run a script from 1-21 Everyday but saturday, run from 21-0 So I was thinking this would work: 5 1-20 ...
-2
votes
1answer
64 views

Bash and cron error [duplicate]

The following cron job fails to execute. What's wrong with it? It works fine when I run it directly from the shell prompt. www-data@etl:~$ crontab -l SHELL=/bin/bash MAITO="" 0 5 * * * export ...
1
vote
3answers
75 views

crontab cannot find script

I have a cron job that runs under my user once per night. I installed it using crontab -e and a by adding the line: 0 1 * * * /home/username/diskreport.sh The crontab is set up so that ...
2
votes
1answer
60 views

Disable mailing in cron globaly

The web is full of suggestions how to disable mailing in cron like asked here stop linux from emailing me cron errors?. Is there really no global config flag I can set to disable mailing in cron for ...
0
votes
1answer
210 views

Compress and remove logs from jboss on linux with cron

I need to compress and remove log files after some time from serwer. I have never write scripts before. So far i have script logs.sh: #!/bin/bash LOGS=/usr/local/jboss/server/default/log/ ...
1
vote
2answers
250 views

Linux Bash IF conditions not processing when running as crontab

So I've made myself a little script which monitors my served directories for any PHP files which have changed. It's designed to run every 5 mins from crontab and email me any changes so that I can ...
0
votes
0answers
49 views

Postfix/Dovecot Service

I have installed Postfix 2.10.2/Dovecot 2.2.5 on RHEL 5.9 from a source code, I forced Installation to be in my own directories not Defaults, I need to add Postfix/Dovecot under services or init.d to ...
0
votes
0answers
24 views

Difference between 2 crontab settings [duplicate]

Can anyone tell me difference between following crontab settings : 5 00 * * * /myscript.sh >> This means for every 00:05 and 5 * * * * /myscript.sh >> The second '*' is for hour ...
2
votes
1answer
48 views

CRON job running but no sign of it in any file

This is an odd one and I know that the answer will be something simple that I have over looked... I have inherited responsibility for a Linux server running an old version of Ubuntu 10.04, it has a ...
1
vote
1answer
113 views

One-line backup, compress, scp database file

I support a company with a remotely hosted web site. They use PostgreSQL dbs. I can't write scripts on the remote server, and I don't want to store any backup files on the remote server, but I can ...
-1
votes
1answer
108 views

Restart crontab @reboot rule without actual reboot

I'm using crontab with a @reboot entry which starts a script containing a endless while-loop that is processing the output of a tail -F command. Is there any way to stop the currently running script ...
-1
votes
1answer
48 views

Configuring / Securing credentials required by batch job

I have a batch job which should run as cron job on a Linux server. This job requires some credentials to do it's work. Idealy I don't want to have that kind of credentials stored on my server, but ...
0
votes
1answer
303 views

Cron won't use msmtp to send emails in case of failed cronjob

I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error. I'm using Debian Wheezy. Cron is working normally (without the email ...
2
votes
1answer
95 views

Why is cron mailing me program output even though I've redirected to /dev/null?

I'm trying to restart a system process through cron and getting emailed the startup output of the process. I thought redirecting STDOUT and SDTERR to /dev/null would "silence" the output but alas, ...
0
votes
0answers
38 views

need at jobs identified by name (advanced atd daemon)

Sometimes I'd like to delete or overwrite (or simply cat) an at job. Unfortunately, the at jobs are identified by a sequential number (file in /var/spool/cron/atjobs), which makes those operations ...
1
vote
1answer
425 views

Crontab maximum command length

Is there a limit of characters a command in a crontab could be ? I have a crontab with a 178 characters command and it seems to be truncated at 164 when executed. I can tell this number from the ...
4
votes
1answer
112 views

Why is crontab file periodically overwritten?

I have a Ubuntu 12.10 server with an nginx user that I use to edit a crontab file. Periodically (maybe once every few hours? it's hard to tell), I notice that edits I have made as the nginx user have ...
-1
votes
2answers
97 views

running a cron job on a time interval [duplicate]

Is it possible to run a job for 2 hours at a specific time? So lets say I want to run wget command that calls/hits an endpoint in my web app for 2 consecutive hours in a day. Meaning that every single ...
1
vote
1answer
24 views

Cron: where is the /etc/cron.d defined? Is it possible to add a new directory?

In CentOS, where is the /etc/cron.d folder defined? Is it possible to add a new folder that works exactly as it? Example: I have another folder ( /mnt/software/cron ) full of files with the exact ...
1
vote
3answers
739 views

How can I run a Cron job to make backups of a MySQL server by SSH

I have a production server running CentOS with a MySQL database. At home, I have a QNAP NAS (runs a little embed linux). I want to make a Cron job on my NAS to backup the data from my CentOS ...
3
votes
2answers
884 views

Setting timeout for cron jobs

Do Ubuntu Linux cron (Vixie cron?) support setting timeout for its jobs? Specifically, the process would be killed after X seconds unless it finishes successfully by then. I have had some cases ...
-1
votes
3answers
268 views

Are Linux cron Jobs each executed sequentially or in parallel?

Lets say I create two cron jobs: Cron Job A, runs every day at 8:00AM Cron Job B, runs every day at 8:05AM However, Cron Job A, takes 12 hours to run (don't ask why, this is an example). Will ...
-1
votes
1answer
117 views

How can I check cron task it's running? [duplicate]

I put a cron script in /etc/cron.d: [root@node ~]# cat /etc/cron.d/reconfig 0 */6 * * * root /root/bin/reconfig.pl But I get no list of cron tasks for root: [root@node ~]# crontab -l no crontab ...
0
votes
3answers
108 views

script bash can't get difference in $PS1 or $- when running interactivelly or via cron

I want my cron scripts being executed verbosly when run interactively by a system user (for debug purpose for instance) and quietly otherwise (for cron, as I want receive e-mail if and only if I get ...
1
vote
2answers
61 views

Is there a way to source cron jobs from a file

One of our servers has around 20-25 different cron jobs scheduled on it. Usually, we periodically check-in the cron jobs to a file in the repo using crontab -l > cron.jobs While bringing up a new ...
1
vote
1answer
252 views

Strange syslog for my server

Today i go on my log with nano /var/log/syslog I have this, and i think it's not very good : Aug 27 06:25:02 ks3309528 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="2235" ...
2
votes
2answers
208 views

check if process is running, even under cron

I have a cron job that runs every minute, but if it finds data, might take many minutes to finish. I need to tell if another instance of the script is running from another. To make things even more ...
0
votes
1answer
48 views

Strange crontab behaviour [duplicate]

This evening I have been playing with cron for the first time, and have started experiencing strange results. The script that I am trying to run is a watchdog that allows me to manage a couple other ...
4
votes
1answer
106 views

How can I create cron jobs in specific files on Linux Centos

I want to have a separate folders for cron jobs like: /mydata/cronjobs Now in that folder I want to have files like backup_server which will have the content like: 30 3 * * 1-5 ...
1
vote
2answers
289 views

How to prevent termination of long-running Python script

I have a cron job running a Python script on a VM-based remote Ubuntu server. The script takes a couple hours to run, and I'm noticing the kernel appears to be terminating the script before it ...
6
votes
1answer
356 views

how to execute a command on the first, second, third and fourth Sunday of the month with crontab [duplicate]

I have 4 servers and I want each one of them to execute a reboot on Sunday. Server 1 - first Sunday of the month (first week) Server 2 - Second Sunday of the month (2nd week) Server 3 - third Sunday ...
0
votes
1answer
65 views

what is the meaning of *this* crontab setting?

* */1 * * * sh foo.sh I found this setting on one production machine. And foo.sh was executed every one minute. I am guessing that the original author of this setting wants it to be executed every ...
0
votes
1answer
41 views

Can't locate cron service, how to start it?

# rpm -qa | grep cron crontabs-1.10-5.noarch I have the above version of cron installed on my RHEL 6 server. My crontabs commands aren't reconginzed: # crontabs -l -bash: crontabs: command not ...
-3
votes
1answer
25 views

cronjob every sunday of the week [duplicate]

Hi all I have an ubuntu server where I want to create a cron every sunday al 23:00 I have read manual and I have try to use some cron generator. I have tried in this mode: 0 23 * * * root test.php ...
1
vote
1answer
512 views

cron daemon forking multiple processes and running jobs multiple times

I'm running a bunch of cron jobs (set up using sudo crontab -e) on Ubuntu, and recently (though I don't know when to be sure) I'm suddenly seeing the same jobs appear to be run multiple times in the ...
0
votes
1answer
193 views

Why this command does not work from cron.daily file?

I have a file in cron.daily: root@nagios.example.com:/# cat /etc/cron.daily/nagios-logs /usr/bin/nice -n 19 /bin/gzip --fast /var/log/nagios3/archives/* root@nagios.example.com:/# ls -l ...
3
votes
2answers
621 views

Why this script in cron.daily won't run?

I wrote this small Python script to make daily backups of a directory containing some files (the backups should rotate after one week). This is it: $ cat /etc/cron.daily/file-store-backup.py ...
15
votes
2answers
496 views

Is there a utility like cron, that schedules a job for later (but only once)?

I'm trying to design a program that sends a text when a certain (non-periodic) event occurs. Right now, I'd like a script that finds when this event occurs, and then schedules a (cron-like) job that ...
1
vote
1answer
128 views

Getting cron logs to add to file, not override it

First, I'm sorry if this is the wrong stackexchange for this, but it seemed like the right one. This is my crontab right now: MAILTO=****@gmail.com 10,30,50 * * * * ~/webapps/****/apache2/bin/start ...
0
votes
2answers
205 views

Does cron maintain an in-memory directory cache?

We run a large distributed Linux computing environment where a user's home directory may be moved between different back-end filestores due to their affiliation and general distribution between ...
1
vote
4answers
999 views

Randomizing minute for crontab entries between servers

I have a common puppet recipe for a set of our servers. One of the puppet-managed files is /etc/crontab that contains the original cron.daily, cron.weekly and cron.monthly entries. The problem of the ...
0
votes
1answer
77 views

Changing IP of the machine at regular intervals

I have a pool of public IP addresses. There are some services in my box which binds to these. What i'm trying to achieve is to automate the IP change process. Best way to do this is to write a script ...
1
vote
3answers
99 views

Cron - Does not execute command every 10 mins

I don't understand why cron is not really executing the command every 10 minutes. in crontab -e I have added: */10 * * * * /var/www/myproject/recording/batch.pl I could see in the cron log it is ...
0
votes
1answer
237 views

Cron permissions?

I have a bash script which if I run manually (as root) performs all of its tasks without issue. The tasks are just a few php scripts and then a "mv" to move the process file to a temporary folder. ...
0
votes
1answer
122 views

rdiff-backup simultaneously

into my backup Linux server (Ubuntu) I have done a system to backup my three servers. Into etc/crontab I have write line like this: 0 0 * * * user rdiff-backup -v9 user@111.111.111.111::/var/www/ ...