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)

12
votes
11answers
11k views

Techniques to Monitor cron tasks?

Are there good techniques for monitoring cron tasks over a cluster? We're starting to use cron to launch tasks at daily intervals. A few ideas for checking out information: Add special application ...
0
votes
7answers
2k views

Not running a cron job when the prev run was not finished

How can I block a cron job when the previous run was not finished. Its a cron job which is running every 5 minutes, but sometimes it needs more than 5 minutes to run. Edit The script which is called, ...
0
votes
4answers
470 views

cron clock problem

I have noticed on my RHEL 5.5 that cron daily starts an hour later (at 1AM instead of midnight). System and hardware clock are the same. How can i set it so it will start at midnight? date [root@a ...
0
votes
1answer
54 views

Periodically run an MS SQL query on multiple sites

I have been tasked with pushing Google Analytics data periodically to SQL Server 2005 running on a different server from various websites (about 450 of them) grouped on various servers. I understand I ...
1
vote
1answer
94 views

Weird syslog order

Have you ever seen wrong order in /var/log/syslog ? I think that it causes only crontab. Jun 28 22:20:01 alex CRON[2327]: (root) CMD (something > /dev/null) Jun 28 22:21:01 alex CRON[2700]: (root) ...
1
vote
4answers
555 views

Make cron log rsync only if there was transfer

I have this crontab running every 5 minutes: date >> ~/18/rsync.log rsync -vaz user@r18:~/assets ~/18 >> ~/18/rsync.log 2>&1 It adds this to the log file every 5 minutes: Thu ...
0
votes
2answers
659 views

In Amazon EC2, how do I make it run a python script when I “clone” that instance?

Suppose I have a script in /home/myuser/go.py How do I run that script, when a new instance is booted? (I'm used to using the point-and-click control panel Amazon has...)
7
votes
4answers
13k views

How to disable everything in crontab -l?

I just want to pause everything. Don't execute anything listed on crontab -l.
0
votes
2answers
41 views

rsync last 3 days plus weekly backups

I have a shell script that i'll be running with a crontab. Basically I want to modify this so I can do daily backups for the last 3 days. I've seen examples where the last 7 days are backup. I just ...
0
votes
2answers
787 views

Email is not sending when the script is running by CRON

I wrote the simple backup bash script and at the end of it, it's sending an email to me that backup is ready. Everything works perfect when I run this script from terminal (root), but when the script ...
11
votes
5answers
10k views

How can I prevent cron from filling up my syslog?

I have a script which needs to be executed each minute. The problem is that cron is logging to /var/log/syslog each time it executes. I end up seeing something like this repeated over and over in ...
1
vote
1answer
25 views

Cron: possibility to specify a hours to start/stop on a specific day

What is the crontab syntax for specifying running hours/minutes based on the day of the week in a single entry? There's a task which needs to be executed every /1 minute from Monday,01:00 to ...
0
votes
1answer
29 views

Ubuntu 10.04 cronjob with curl dosen't work

I would like to execute some php script via cron job i have curl, crontab installed, but the cron job dosen't run/create any log file. crontab -l * * * * * curl ...
0
votes
2answers
129 views

munin-cron Unable to Copy Contents

I recently installed munin on my (Fedora12 based) server. Now, I wanted to get all the graphs in a static directory (The application runs on Django). So, I edited the file /etc/munin/munin.conf by ...
2
votes
3answers
252 views

Is it possible to assign a nice and ionice priority to all scripts executed by cron daemon?

To be a bit more concrete: I have a Debian Squeeze Linux machine with a web application that should become available all over the planet. Until now I had a bunch of resource consuming cronjobs each ...
0
votes
1answer
46 views

can I use @reboot in cron.d files? [closed]

I want to run a job with cron on reboot as a particular user. I have been able to do this successfully using crontab to write to /var/spool/cron/crontabs/username with something like: @reboot ...
0
votes
1answer
106 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
95 views

Why does my cron job sometimes fail on wget: unable to resolve host address [closed]

My cron job runinng properly .But sometimes it get fail with following error message" failed: No address associated with hostname. wget: unable to resolve host address "
0
votes
0answers
9 views

Setup cronjob with SSH crontab [duplicate]

Someone can help me to setup cronjob with crontab. I have run command crontab -e -u root 01 0 * * * /usr/bin/php /var/www/web/daily/testssh.php But it always get error: crontab: usage error: no ...
0
votes
1answer
50 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 ...
20
votes
3answers
7k views

What does * * * * * (five asterisks) in a cron file mean? [duplicate]

The first noncomment line in a legacy crontab file begins with five asterisks: * * * * * ([a_command]) >/dev/null 2>&1 The authors are gone, so I do not know their intent. What does ...
9
votes
2answers
6k views

Better logging for cronjobs? Send cron output to syslog?

I am looking for a better way to log cronjobs. Most cronjobs tend to spam email or the console, get ignored, or create yet another logfile. In this case, I have a Nagios NSCA script which sends data ...
0
votes
0answers
13 views

Cronjob doesn't run [duplicate]

I'm running a FC14 server (2.6.35.13-92.fc14.i686) and I'm trying to add a simple cronjob. I've edited the /etc/crontab file and now it looks like this: SHELL=/bin/bash ...
-1
votes
1answer
62 views

Allow nginx www to run Centos at command

I have a job which created by PHP script running as www (nginx) 31 2014-06-09 19:08 a www After the time passed, the job is executed but nothing happens. But if i run it as a root, 32 ...
-3
votes
2answers
63 views

Remove all files in directory except last 20

I have question why is my cmd for "removing all files in directory except last 20" not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d ...
0
votes
1answer
30 views

how to increase the size of /var/log/cron on cent os 6.4

how to increase the size of /var/log/cron on cent os 6.4. I wanted to keep the logging history longer. Thanks!
0
votes
0answers
28 views

Bash Script issue : Discrepancy in output when executed via cron [duplicate]

I have written a bash script that writes date and database size of a DB to a text file. The script is executed via cron every week. There is some discrepancy in the output that is being generated . I ...
0
votes
1answer
108 views

Shell script only executes partially when run with CRON [duplicate]

I've written a shell script that does the following: Retrieve mail from a POP3 account (using GetMail) Save a copy of that email to S3 (using AWS CLI) Email me the filesize of the email The ...
-1
votes
1answer
30 views

run ubuntu crontab every 19th of the month in 2am [duplicate]

i'm not sure about something and that's why asking i want a process to run every 19th of the month in 2am i don't want the cron to run after that time or before and only when the date is 19th - in ...
0
votes
2answers
137 views

Cron getting timeout when attempting to access url (wget).

I'm sure this is simple and I've been digging but no answer is quite as specific as I need it to be. The goal is easy, have Cron hit a url on my server every 5 minutes. All of that is set up and ...
25
votes
7answers
40k views

How to get e-mail from (failed) cron-jobs in Ubuntu?

I create cron-jobs in Ubuntu by placing the executable in one of /etc/cron.{daily,hourly,monthly,weekly}. There are lots of directories starting with cron: kent@rat:~$ ls -ld /etc/cron* drwxr-xr-x 2 ...
1
vote
1answer
224 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
50 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 ...
1
vote
0answers
52 views

Publicly available black list for web servers [closed]

I'm a bit surprised to find that there really aren't any publicly available RBLs for web servers. Yes, there's project honeypot but you have to hit their API in realtime in order to check a given IP ...
20
votes
6answers
2k views

Outgrowing cron: what's the next scheduler?

We've been using cron for about as long as I can remember to handle all of our job scheduling needs. Everything from storage clones/snapshots to reports against databases to daily system reports to ...
0
votes
2answers
70 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 ...
0
votes
0answers
43 views

Strange behaviour with cron script not running [duplicate]

I recently stumbled upon a strange issue with cron on Ubuntu 13.10. I have a Ruby On Rails rake task (background task) that needs to be run on Cron every 3 minutes. So the script itself works and ...
4
votes
4answers
1k views

Bash script is not working as cron job

I have the following shell script $cat capture.sh TIME=$(date +"%H-%M-%d-%m-%y") IP="203.208.198.29" PREFIX=$TIME$IP tshark -f "udp" -i eth0 -w /root/captures/$PREFIX.cap& pid=$! sleep 2m ...
0
votes
1answer
61 views

logwatch on Centos 6.4

My logwatch is configured correctly and is working correctly when I issue manually /usr/sbin/logwatch I added it to root's crontab and it is listed correctly when I make crontab -l which gives: 0 ...
3
votes
1answer
51 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 ...
1
vote
1answer
72 views

Programmatically adding two lines to crontab

I'm trying to add two lines to the root crontab when building an AWS instance. I have a set of commands that are part of the "user data". These commands are run as root when creating the instance. I ...
3
votes
2answers
72 views

hg pull from Bitbucket fails when run from cron

I have a local copy of a Bitbucket repo on one of my servers (under the user rob), and I created a script that runs every hour in cron and attempts to pull & update the local copy. The issue I'm ...
-6
votes
1answer
73 views

execute script at particular time in amazon ec2 linux [closed]

I am newbi in amazon ec2 as well as linux, I am working on pentaho kettle, for starting my job process i m using following command in amazon ec2 instance, cd /dev/pdi/data-integration (reaching to ...
1
vote
0answers
47 views

Incrontab does not execute command

I have copied this question over here from unix.StackOverflow When I use incrontab out of the box, I mean no changes, I get no result, as if the cmd was not executed. my incron line is : /crrae ...
6
votes
3answers
332 views

Crontab job dependency to prevent race [closed]

I want to run a cron every 5 minutes, but I don't want the next cron to run if the previous did not finish yet. What can be done about this? Are there any tools to support this? Thanks
-1
votes
2answers
118 views

Why cron job is not able to open X display connection [closed]

I have a java app rendering some sprites using LWJGL and OpenGL. It works fine until I move it to remote virtual machine with no phisical graphic card, Mesa 3d with related stuff is used to emulate it ...
2
votes
3answers
1k views

Reboot if tomcat7 service is not responding

I am running a web app on a Tomcat server. There is a hard-to-detect problem within the server code that causes it to crash once or twice everyday. I will dig in to correct it when I have time. But ...
-3
votes
1answer
44 views

Replace of cron job/cron tabs— Windows Scheduler [closed]

I want to know that there is any way to create an script on windows machine in PHP that should run after an interval, let's say every after 15 minutes. Currently I'm doing it using javaScript, but ...
4
votes
2answers
205 views

Crontab and dayofweek

I'm trying to set up a cron job that runs once a week on Sunday. I think I'm supposed to use the "dayofweek" position with it set to 0, but I'm unsure if this overrides the "*" for the day position. ...
-1
votes
1answer
543 views

Scheduled Task issue - /usr/bin/php/: No such file or directory

Can't get it working, I want to set up a cron job for a domain user in plesk 11.5, but seems that there's a problem to find the php executable. The command is: /usr/bin/php/ -f ...