Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

learn more… | top users | synonyms (2)

6
votes
1answer
546 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
67 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
2answers
66 views

cron job to archive files older than xyz days [closed]

I would like to archive all of the files older than Xdays. the files are in /home/user1/ and i would like to move the archive to /home/user1/folder_backup/ i am running ubuntu server 12
1
vote
1answer
159 views

Crontab group permissions

I have noticed on my debian machine that the crontab user does not have read permissions on the /var/spool/cron/crontabs directory. drwx-wx--T 2 root crontab 4096 Jun 20 21:34 crontabs Further more ...
0
votes
1answer
222 views

Why is this cron job with shell script failing? [duplicate]

I created a cron job to do a daily backup, to store it in the directory /backups This backups directory is located at the root [/] of the VPS server and is a separate backups partition provided by ...
0
votes
1answer
44 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 ...
0
votes
3answers
536 views

script PHP doesn't work in crontab [duplicate]

Good morning, I have into my ubunut server a script that check into a database some value and if the condition is true send some email. If I launch into the browser the script like: ...
-3
votes
1answer
27 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
47 views

Setting up a new job using ubuntu's crontab [duplicate]

I have little experience with setting up cron jobs. I need to configure a cron job to delete all files starting with the filename 'sess_' from the '/tmp' folder every hour. If I fire up the crontab ...
0
votes
1answer
90 views

Cron job: stdout to /var/log, stderr to email

I have a cron job that is running every hour, and providing output (over stdout) similar to the following: Found 1 batch jobs {'job': 'update'} Job 1 started at 2013-06-07 13:00:03.673683+00:00 ...
-1
votes
1answer
508 views

ESXi 5.0 can't parse crontab (ghettoVCB) [duplicate]

I'm trying to run ghettoVCB via cron on a ESXi 5.0 Machine. This is the command (add some linebreaks for better readability) /vmfs/volumes/VMs\ Pool/ghettoVCB-master/ghettoVCB.sh -f ...
0
votes
2answers
846 views

Cron job in webmin

I have a webmin on Centos server. I want to create custom cron job. However there is cron job setting options available under "Scheduled Cron Jobs" tab. But if I want to set weekly cron then there it ...
-1
votes
1answer
66 views

Cron and FTP daemons crashing randomly in RHEL

Not sure where to start in troubleshooting this. I'm not finding anything indicating an issue in ProFTP logs or in /var/log/messages. So I do apologize for not having more information to give. ...
0
votes
1answer
58 views

crontab in different sessions

I started a crontab job in a server remotely (in a screen session) from a local machine. Days later, I terminated the screen session and restarted my local machine. The cron job in the server is still ...
1
vote
1answer
236 views

Cron expression that runs every 5 minutes from 1:30 am - 6:00 am [duplicate]

I'm looking to run a job at these very specific times. Can this even be done in one expression?
0
votes
0answers
100 views

Why doesn't this cron behave the same way when run from CLI?

I have this cron for user root (obtained with crontab -l): 20 10,14 * * 1-5 /usr/sbin/puppetd --onetime --no-daemonize --logdest syslog > /dev/null 2>&1 When it is run, it is supposed to ...
0
votes
2answers
370 views

mysqldump in cron not working [duplicate]

I am trying to do a mysqldump on the cron for every 5 minutes but it seems that it is not working. I try to execute the mysqldump and it works fine. mysqldump mysqldump -uroot -ppassword ...
1
vote
2answers
178 views

Which user should cron jobs run as?

Ubuntu server with users root www-data mywebsite1 mywebsite2 There are multiple websites hosted on this server, each with their own user. Each website has their own cron jobs mostly ...
1
vote
2answers
201 views

Read-only cronjobs for users

Here's a weird issue. I want to make crontab for a user that is read-only for that particular user and can only be managed via root. Sounds easy? Here's the catch: $ ls -alh /var/spool/cron/my_user ...
0
votes
1answer
25 views

Ubuntu Server scheduleing a cron job not working

I am trying to schedule a cronjob on my ubuntu server through SSL. I ran the command: sudo crontab -e Then once it created a new file for my user, I put : * * * * * php /etc/php5/apache2/php.ini ...
2
votes
1answer
68 views

schedule a job to run only “once” after 50 seconds

I have a process which is designed to do a specific task in case of events. Requirement is to run a specific command 50 seconds after an event occurs. Cannot modify the code to put sleep there as it ...
2
votes
2answers
2k views

how to execute bash script with crontab in centos? [duplicate]

My bash file is not executed by cronjob created as root. The cronjob setup looks as it follows 0 0 * * * mysql_backup.sh does need to be decalared with the bash command 0 0 * * * bash ...
0
votes
2answers
803 views

centos cron logs are not executed

I have been trying to setup a cronjob on centos but doesn't seems to work. I have been deleting the crons logfile to see all newly created logs and I have been restarting crond but /var/log/conf ...
9
votes
1answer
3k views

How do I make cron run every other Sunday on the OTHER Sunday?

I have a cron job that runs at 0 0 * * 0/2 -- i.e. every other Sunday. It just ran now, for instance. However, I want it to run on the other Sundays -- next Sunday, rather than this one. Another ...
0
votes
1answer
70 views

No way to make a specific cronjob work [duplicate]

I installed nginxcp on my server and they recommend to add the following cron: 0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client I already added it to var/spool/cron and restarted crond ...
0
votes
1answer
270 views

Review of a crontab script to add timestamps to minutely runs; any suggestions?

I've got a crontab job set to run minutely as such: * * * * * /home/username/public_html/domain.tld/production/scripts/cron_runner.sh My goal is to add some timestamps to output from cron so I can ...
0
votes
2answers
79 views

using ssh to automatically retrieve info from remote box

Greets all. I need a 'basics-202' question answered; it's been a while. From a cronjob, how do I automatically ssh to a remote box to retrieve information that normally requires root equivalence to ...
1
vote
1answer
201 views

What could cause a PHP script run as a cron job to end up in D state?

My server is running Ubuntu 12.04 LTS (precise) and I'm having a weird issue. The server is hosting a large website which is used for data collection. The website is in PHP and uses Zend Framework. ...
0
votes
2answers
1k views

Crontab not sending e-mail with output [duplicate]

I'm having a strange problem here with crontab. I have set up the crontab correctly to run the cron job as follows: [user@user ~]$ crontab -e SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin ...
-1
votes
1answer
89 views

Cron Find & Replace via ssh - send a result via mail [closed]

I'm having a small issue, i'm running and cron task every 5 minutes which is looking text chain and replacing it with nothing.. In order to optmize something i would like to add a new function to my ...
1
vote
1answer
841 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
231 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 ...
4
votes
2answers
892 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 ...
0
votes
2answers
84 views

Checking that PostgreSQL and Apache are running on Ubuntu?

I am trying to learn the best practices for checking that Apache and Postgres are running on my server. If either of them have stopped, I want to auto-restart these services. I'm using Ubuntu 12.04 ...
15
votes
2answers
504 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
193 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 ...
1
vote
2answers
2k views

Why does cron not mail me the job output?

Here's my crontab: MAILTO=michael 02 11 * * * bash /home/michael/projectname/nightly_tests.sh * * * * * python /home/michael/projectname/throwaway/hello.py My username is specified correctly: ...
0
votes
2answers
656 views

Debian webserver - Crontab error (not running php script)

I've a webserver with several sites and I'm trying to run a script by crontab but it gives me a error (126 and 127) My script is in: /var/www/site1/script.php When I run the command: php ...
0
votes
2answers
266 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 ...
0
votes
0answers
204 views

mysqldump not working/running via cron job [duplicate]

I have a crontask which runs at 1am every morning and dumps all databases. 0 1 * * * /var/backups/dumpit.sh 2>&1>> /var/backups/dumpit.log The dumpit.sh source: #!/bin/bash ...
-1
votes
2answers
97 views

Centos 5 - Configuring a crontab PHP job [duplicate]

I'm running a CentOS 5 server, and trying to schedule a job which runs a php file every day at the same time, I've added a new file to the directory /etc/cron.d/ called get_files The get_files ...
0
votes
2answers
469 views

Crontab on Ubuntu Server 12.04 doesn't run as it should (PHP script)

I have a PHP script which downloads and manipulate an image from some server and then saves it locally. Because image is update every 5 minutes I want to download and save that image every 5 minutes ...
2
votes
2answers
559 views

Cron job executed multiple times daylight saving time [duplicate]

We run a CentOS release 6.2 (Final) 2.6.32-220.13.1.el6.x86_64 with a stock cronie.x86_64 1.4.4-7.el6. On Mar 31 we moved to summer time: 03:00 become 04:00. In crontab we have: 0 4 * * * ...
0
votes
2answers
220 views

crontab -u admin -l doesn't list cronjobs that are defined in directadmin backup crons as admin user

I have defined 1 cron job to take a backup of all of my users in Directadmin. Some users needed more than just one monthly backup. So I logged in again as admin user and went to Admin Backup/Transfer ...
4
votes
0answers
5k views

Do I really need the PHP maxlifetime hourly cron job? [closed]

On my Debian Wheezy, every half-hour a cron job runs: find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} ...
1
vote
4answers
2k 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
517 views

@reboot cron directive doesn't work on Solaris? What do I use instead?

I just tried to use contab -e on a Solaris server to add this line: @reboot /root/reboot.sh The script starts up the web application. But the trouble is that this syntax is rejected. # crontab -e ...
1
vote
2answers
220 views

Run php script every 3 seconds

how can I set a cron job or a php script details to run a php script every 3 seconds between 11:30 PM and 12:30 AM (23:30 - 0:30)? Thank you very much for your help
0
votes
1answer
43 views

Options for Executing Scheduled Scripts on a PHP Server

I have a server that I've setup running PHP. This serves JSON files and is running fine. I also have several scripts that reads data from an outside source, connects to my MySQL Database Server, and ...
2
votes
1answer
561 views

logrotate cron job not rotating certain logs

I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext ...