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)

-1
votes
2answers
294 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
147 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
158 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
24 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
66 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
1k 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
622 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
2k 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
68 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
262 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
68 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
193 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
922 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 ...
0
votes
0answers
133 views

Contab running multiple times every minute CentOS

I have two crontabs setup on my server. One that runs every minute and one that runs every 5 minutes. */5 * * * * ~/aws-scripts-mon/mon-put-instance-data.pl --mem-util --disk-space-util --disk-path=/ ...
-1
votes
1answer
86 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
725 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
214 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
767 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
75 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
501 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
158 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
531 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
236 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
203 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
96 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
451 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
384 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
181 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 ...
5
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
1k 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 ...
-1
votes
1answer
469 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
188 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
489 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 ...
0
votes
1answer
143 views

Logrotate rotating daily but should be rotating weekly

For some reason logrotate is rotating logs daily instead of weekly, even though all the config files for logrotate seem to be set to weekly. Any ideas? /etc/cron.daily/logrotate #!/bin/sh test -x ...
0
votes
1answer
617 views

rsync over ssh fails as cronjob works on shell - NAS4Free

This is my rsync.sh in the home directory of my backup user $ cat rsync.sh #!/bin/sh rsync -avvvz --stats --log-file="/var/log/rsync_client.log" -e "ssh -i /mnt/stor0/backup/backup-rsync-key" ...
0
votes
3answers
1k views

Cant run rc.local manually and doesn't run automatically on ubuntu

This is quite a simple one. I created an rc.local file here: /etc/rc.local I made it executable. However, it doesn't run when I boot the server. I can see it in the directory and when I try to run ...
0
votes
1answer
83 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 ...
0
votes
0answers
220 views

dd-wrt obfsproxy - Cant start on startup or via cron job

Router: WZR-HP-AG300H Firmware: DD-WRT v24SP2-MULTI (06/03/12) std - build 19154 To get obfsproxy installed on my router I went about Installing Opkg With opkg installed obfsproxy and busybox ...
0
votes
1answer
153 views

Running cronjobs with proxy

I have a requirement where I have to run several cron jobs with specific IP in an EC2 instance. That specific IP is used by another EC2 instance. I have access to that EC2 instance. Is there any ...
0
votes
1answer
55 views

Centos: List all cron jobs in a week ordered by date

I'm trying to get all cron jobs in the current week (or from monday to sunday) ordered by schedule time. I'm trying with some elaboration on the output of the command crontab -l I appreciate ...
-1
votes
2answers
105 views

Curl don't work on cron execution

I have bash a script like the following #!/bin/bash date curl http://lab.nextt.com.br/somefile1.html -z ../public_html/somefile1.html -o ../public_html/somefile1.html --silent --show-error ...
0
votes
2answers
902 views

Running multiple cron jobs from single script

I have three different jobs that I want to run from the FreeBSD shell. I would like to consolidate them into a single script, if possible, but I can not find any syntax to do that. Is there someway I ...
0
votes
1answer
215 views

Mysql select query not generating result on cron but is ok via terminal

We have a C program (source is below). We compile it with: gcc -Wall -Wextra -g $(mysql_config --cflags) get1ReceiveSource.c $(mysql_config --libs) -lrt -o get1Receive The select give results ...
1
vote
3answers
100 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 ...
2
votes
2answers
222 views

Why doesn't this command work as a cronjob, while it works perfectly when typed in a shell?

If I run this command from the shell, it works as expected: cd ~ && mysqldump --databases --skip-dump-date --host=localhost --user=admin --password=xxxxx --lock-all-tables ...
-2
votes
1answer
259 views

Stop .htaccess blocking cron jobs [closed]

I have a php script on my site that, when run, changes the 'Dog of the Day' on my home page. I have a cron job set up to run the script once a day, and everything works perfectly. I've secured my ...
0
votes
2answers
355 views

Start script.py after reboot as user xy in Debian Squeeze

How can i start a python script.py after a reboot as user xy in Debian Squeeze automatically?
5
votes
2answers
1k views

Running script in Crontab every 3 days once

I have some Perl scripts which needs to be runned every 3 days once, The following is syntax which I have entered, Can you please let me know, Is this correct or wrong. 30 19 * * */3 root ...