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)

0
votes
1answer
36 views

How can I know which user has cron jobs configured on a machine with 200+ users?

I need to build a new machine and copy properties and some cron jobs from another machine which has about 200+ users and I don't know which users have cron jobs configured. Is there a way to extract ...
38
votes
4answers
40k views

Running Cron every 2 hours

I have the cron job as shown below, and wanted it to run every 2 hours, but it keeps running every 2 minutes. Can someone tell me where I'm going wrong? * */2 * * * /path-to-script
0
votes
1answer
57 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
38 views

Perl FTP script fails from crontab, works from cmd

We have a Perl script we've been using (launched from crontab) for several years to upload images using Net::FTP. Recently we began to notice problems where the images were not uploading and errors ...
0
votes
0answers
26 views

How can I queue a script to run the next time a system is up and connected to the internet? [migrated]

I'm using mailsend (on a Mac) to send mail from the command line. I'd like to set this up such that I can execute a send command, but if my system is disconnected from the internet, that command is ...
7
votes
6answers
6k views

crontab environment

I have written various scripts to launch Java server applications, which are typically run for 24 hours before being shut down (by invoking the same script with a different parameter). The script ...
1
vote
1answer
783 views

Setting 'From' header for cron email using msmtp

I've got msmtp setup on Ubuntu 10.10 so that cron can send me emails. That works like a champ, for the most part. However, emails coming to my gmail account show up as coming from (unknown sender), ...
-1
votes
0answers
13 views

Is there a replacement for cron with webinterface? [closed]

I am searching for a replacement that lets me view and edit the jobs and their schedules in a webinterface. It would be especially good if there's a history of the execution of jobs available or at ...
1
vote
0answers
42 views

cron.weekly runs on wrong day of week on Ubuntu

I have this line in my /etc/crontab: 47 6 * * Sat root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) So the cron.weekly should be started every Saturday ...
1
vote
4answers
93 views

rsync changing already existing files

I have a simple line of rsync in my crontab that gets backup files from the prod server to another. It looks like it is touching the already existing files in the destination folder. This way, the ...
0
votes
1answer
32 views

Binding timestamp value to a variable in crontab

I'm basically trying to declare a variable with a date() value in crontab as I will constantly be using the same date structure over and over, here is what my crontab looks like so far. php = ...
6
votes
1answer
67 views

Processes hanging indefinitely when calling read(2)

I have several Debian (Wheezy, x86_64) servers all exhibiting the following behavior: All of the servers have a set of cron jobs that, among other things, pull data from S3. These usually run fine, ...
0
votes
2answers
56 views

Backup Ubuntu server with cron/rsync: Problems with resuming large files

I currently have a dedicated Ubuntu backup server which wakes itself up from suspend (using rtcwake) daily. 5 minutes later a cron BASH job kicks in, using rsync to pull files from various network ...
-1
votes
1answer
41 views

sending email from cron in html format not text

i am trying to send email every 1 hour from cron job which is executing a php script that fetches data from database and shows in a table format. i have CentOs 6.1 where i created my cron job.firstly ...
1
vote
1answer
40 views

When cron is completed How to get email notification and log in a file (both)

I am a Newbie to linux. I'm trying to figure out things. Can someone kindly help me how to combine these two commands? (1) Normally cron can results can be directed to a log file by editing crontab ...
0
votes
0answers
21 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 ...
2
votes
7answers
1k views

How to monitor cron tasks and get emails when they don't run?

I realize that when any cron has output it will email that output... what I'm trying to determine is that if I have a script scheduled for 3 AM on Tuesday and for whatever reason it either throws an ...
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
1k 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
450 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
32 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
79 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
526 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
1answer
48 views

Server incremental backup to AWS Glacier

I'm looking to backup various directories and files from a Linux server to AWS Glacier. I'm trying to work out the details on how to do manage this. Incremental Backups I want to upload files ...
0
votes
2answers
640 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
12k 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
34 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
712 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
21 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
24 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
60 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
236 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
43 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
85 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
70 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
36 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
6k 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
5k 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
55 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
47 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
27 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
68 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
21 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
96 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 ...
4
votes
1answer
3k views

Users cannot use crontab after password security upgrade

I have a box being upgraded from CentOS 5 to CentOS 6. On the original server, all users have MD5 passwords. The upgraded server is now using SHA-512 passwords. Users who have changed their password ...
24
votes
7answers
39k 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 ...