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
0answers
25 views

why is cron flooding wtmp and last?

When I type the last command, I see a bunch of entries in there for cron. Every single cron job that gets run creates an entry and it's flooding wtmp with unnecessary entries. Any ideas how I can stop ...
0
votes
1answer
31 views

How to use .profile alias in crontab [duplicate]

I've read the answers to this question, but still don't understand what to do: How to use my aliases in my crontab? I am logged onto my Ubuntu server as root. I have the following command in my ...
72
votes
9answers
80k views

When does `cron.daily` run?

When do entries in cron.daily (and .weekly and .hourly) run, and is it configurable? I haven't found a definitive answer to this, and am hoping there is one. I'm running RHEL5 and CentOS 4, but for ...
0
votes
3answers
265 views

Linux Cron: Can I displace the runtime by “x” minutes?

NOTE: I'm a big newbie when it comes to *nix. I have a cron configuration that runs several programs. Most of them run once a day, and they're set at different times (2AM, 3AM, 4AM, etc) so they ...
0
votes
0answers
30 views

Using placeholders or environment variables in sudoers

Is it possible to use in sudoers rules any kind of placeholders (not just wildcards) or environment variables? What I would like to do is to verify that user (the one sudoing a command) passes as an ...
1
vote
1answer
50 views

Kill old php cron script

After running ps aux | grep php, I found about 10 php scripts ran by cron that have started over a week ago and are hanging. Each script usually take 40 seconds to complete. I have set ...
0
votes
2answers
86 views

Crontab: Authentication token expired; new one is required

I have a crontab job running daily as a non-root user job. Unfortunately it did stop working with the following message (in /var/log/syslog): CRON[29256]: Authentication token is no longer valid; new ...
0
votes
2answers
46 views

Creating a log file inside a script works when manually run, but not when run through cron

I'm using Percona's Xtrabackup tools to back up a database nightly. I wrote a wrapper script to keep the proper number of backups around, write the output to a log file, and email the log file if the ...
0
votes
1answer
31 views

How to do SSH authentication and CVS update automatically from cron job?

I call a script from cron job. In the script it needs to run CVS commands to update from a remote repository. To do that, it needs to SSH authenticate. I put the following code in the script ... ...
0
votes
1answer
47 views

makewhatis and logrotate cron job schedule

In /etc/cron.daily/, logrotate* makewhatis.cron* I understand that above are daily cron jobs. How to display the time set for logrotate and makewhatis.cron? Its not listed when I tried this ...
7
votes
5answers
2k views

Minutely cron, ensuring only a single instance

Is there a way to run a script every minute (or 2, or 5, etc), but only if it isn't already running? We have a set of scripts that need to run every minute. Sometimes they might start and finish in a ...
0
votes
1answer
65 views

124 emails sent at once while one should be sent every five minutes by cron if a certain web service stops running

So I set up a simple script to send an email alert when a certain web service stops running. It has a simple flow of: test = $( curl [address] | grep [a certain string in response] | wc -l ) if [ ...
-2
votes
2answers
3k views

What does -q and -O mean?

What does -q and -O mean in the following cronjob? */30 * * * * /usr/bin/wget -q -O /dev/null http://example.com/moodle/admin/cron.php Thanks in advance.
3
votes
4answers
8k views

Change default crontab editor to nano in FreeBSD

When I edit the crontab using crontab -e it opens the crontab in vi. I'd prefer it to use nano. How can I change this? EDIT: For some reason the export command returns command not found. And ...
3
votes
1answer
219 views

How to schedule a Cron job for the second to the last day of each month

I want to schedule a task for the second to the last day of each month. I have read this great article about shell scripting the execution. I have also seen that you can use "L" to represent the last ...
0
votes
4answers
4k views

Command does not execute in crontab while command itself works just fine

I have this script from Colin Johnson on Github - https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup It seems great. I have modified it to send email to myself every ...
7
votes
6answers
7k 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 ...
0
votes
3answers
2k views

APT FATAL -> Failed to fork

I saw a lot of questions regarding this, but mine seems a little different. Here's what I receive: /etc/cron.weekly/apt-xapian-index: FATAL -> Failed to fork. run-parts: ...
2
votes
1answer
40 views

Do cron and atd run jobs with the same user, permissions and environment?

What's the difference between running a bash script via cron and running the script via atd? Is there any difference? Is it specific to the distro? If so, what about SLES 11?
0
votes
2answers
571 views

Is there a way to restart automatically the HHVM service if I get a '502 Bad Gateway Error'?

I've reported the error on stackoverflow - from time to time my Nginx/PageSpeed+HHVM+MariaDB+WordPress blog stops working. There is some problem with the HHVM service that I don't locate, and I'm ...
-1
votes
2answers
229 views

Start Tomcat through cronjob

To make sure that Tomcat is running all the time, I wrote the following shell script #!/bin/bash status="$(curl -s http://www.domain.com/check)" if [ "$status" != "OK" ] then ...
0
votes
1answer
59 views

How can I tell a script is running under cron?

Is there a standard way to know if a shell script is running under cron as opposed to running from the command line. i.e. I'm thinking of running with more verbose output when manually kicked from the ...
0
votes
2answers
52 views

Do i need to restart after editing anacrontab?

To help trouble shoot a few servers, I have edited the delay time in anacrontab. Do I need to restart anything for these changes to be applied? Thanks
0
votes
3answers
960 views

How can I get the cron daemon to send me email when a job fails with an error?

I have a few Ubuntu boxes that run various cron jobs daily. As far as I know, there is no postfix or sendmail installed. What's the easiest and/or best way to get cron to send me an email when one of ...
0
votes
4answers
711 views

How do you monitor and react when some scheduled job fails? - general question

In many projects my team faced problems with 'silent fails' of some important components. There are lot of tasks executed behind the scenes and if somethings fails (either by errors in logic or ...
0
votes
1answer
46 views

Wal-E cron job not executing

I have a cron job setup that is suppose to be running the wal-e backup-push command. The command works fine if manually ran through the command line. As the postgres user of course. So I setup a cron ...
1
vote
2answers
61 views

cronjob not running daily

I am a linux newbie. With that said I need a cronjob to compress some syslog files after 48 hours to keep the size manageable. These files are currently located in /syslog - a disk I added to handle ...
1
vote
1answer
51 views

WP-CLI doesn't run from cronjob

I made a bash script that uses WP-CLI and was intended to run from a cronjob. It runs fine from SSH, but fails when run through cron. During debugging I discovered that it was the WP-CLI part that ...
-4
votes
1answer
107 views

Crontab - I have two cron jobs but only one works [closed]

I use ubuntu 14.04 LTS. I have created 2 cron jobs but only one works. The 2 different website building with drupal cms. */5 * * * * curl -s ...
4
votes
2answers
433 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) ...
0
votes
1answer
46 views

Include executed cron command when outputting to log

Is there a way I can include the command that was executed in the output when I'm logging to a file? For example: * * * * * date && /path/to/php /path/to/script.php >> cron.log ...
18
votes
9answers
44k views

Running a cron job manually and immediately

(I have already read How can I test a new cron script ?.) I have a specific problem (cron job doesn't appear to run, or run properly), but the issue is general: I'd like to debug scripts that are ...
1
vote
2answers
708 views

How to configure apticron to just report security / critical updates?

We're going to try out apticron, but we don't want to know about every package that could be updated -- only the security / critical updates. How do we configure apticron to do this? PS -- yes, we ...
0
votes
2answers
72 views

Odd Crontab Service SMB Restart Issue

System: Debian Wheezy x86_64 Service: Samaba So when i'm in a terminal i can use service samba restart or /etc/init.d/samba restart to restart the service. When I create a cronjob and do ...
0
votes
0answers
28 views

cron job time managment

I have cron job A and B (both jobs run every minute) from 9.00AM to 6.00PM I like to make the second one run after the first one in 30 second.both cron job should be run by root user. for example if ...
12
votes
4answers
8k views

Is there a way to validate /etc/crontab’s format?

I prefer to stick scheduled tasks in /etc/crontab so I can see at a glance what's scheduled to run, regardless of which user the task runs as. The only gotcha is that the format isn't validated on ...
0
votes
2answers
75 views

Cronjob in cPanel

I'd like to schedule a cronjob on my server to backup the entire public_html directory daily. I am logged into cPanel and I am on the Cron Job page where I have it set to run this command everyday at ...
1
vote
1answer
174 views

OpenShift cron does not run

I have the following file [subdomain.rhcloud.com minutely]\> pwd /var/lib/openshift/username/app-root/repo/.openshift/cron/minutely [subdomain.rhcloud.com minutely]\> ls -lha total 4.0K ...
3
votes
1answer
201 views

Cron Daemon Wget blocked

I've got Nginx on Debian 7 without cpanel. I am seting-up my Crontab like this: */45 * * * * wget "http://example.com/cron-url.php" >/dev/null 2>&1 The above cron is being blocked with ...
0
votes
2answers
74 views

Add cron job to save a web link into txt file

I need to setup a cron job to save a webpage info into a text file in a specified folder at every hour. here is what I've tried: crontab -e in insert mode I typed: 0 * * * * wget http : // ...
0
votes
1answer
162 views

Cron occasionally fails with “grandchild #X failed with exit status 3”

I have cron jobs and every now and then they fail. Just after log message that the command has started, there is grandchild #X failed with exit status 3 message. On the next run scripts finishes ...
15
votes
7answers
16k views

How to change “From:” field for emails from Cron?

I use remote SMTP via nullmailer and it requires set From field to the specific name, but cron set it as root@my.sweet.server.com. How could I change it to something like me@ya.ru?
0
votes
1answer
39 views

Check how much time has elapsed for Cron job and send email

There is a cron job that is set which runs throughout most of the day, sometimes the job gets stuck and I would like to set a time or check on it which let's me know if it has been stuck for more than ...
0
votes
1answer
226 views

ssmtp won't send cron email

I can't figure out why cron on my AWS EC2 (Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64)) can't seem to send email out via sSmtp to AWS SES. This works: echo "test" | ssmtp my@myemail.com ...
0
votes
1answer
1k views

ubuntu crontab -e “/usr/bin/sensible-editor” killed; signal 9 (no core dumped)

Welcome to Ubuntu 11.04 (GNU/Linux 2.6.32-042stab037.1 x86_64) user@server:~$ crontab -e no crontab for user - using an empty one Select an editor. To change later, run 'select-editor'. 1. /bin/ed ...
0
votes
1answer
37 views

cron: What means mail error status “0x0002#012”

I have a cron job specified in the crontab: ... MAILTO=root ... ... 47 09 * * * tst nice -n 15 /opt/tst/bin/doMirror ... The doMirror script fails because of a syntax error. I had expected that the ...
2
votes
2answers
24 views

Is it possible to determine if a job is being started as an at job (kicked off via atd/cron)?

Is there a way to identify a script is being run as an at job instead of interactively from the shell by a user? Some of our scripts have a guard to check if they're running in screen by checking ...
-2
votes
1answer
60 views

Restart periodically two linux server with master slave dependency

My system is configured as follows: database server on a linux server web application on another linux server For sanitation purposes I would like to restart these servers during night at least ...
1
vote
2answers
131 views

Cron job sends out the same data every time despite changes in the database

This question is related to Gentoo Linux. I have cron job that runs every morning at 10AM. The cron job calls a bash script which in turn calls a groovy script that queries the database for a column ...
0
votes
1answer
51 views

Ubuntu VPS not running cronjob [duplicate]

I used sudo crontab -e to add the following cronjob 0 0 * * * /usr/bin/php /var/www/path/to/artisan elite:reset-user-likes The command works correctly if a type it myself on the terminal. I also ...