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
86 views

crontab at reboot for EC2 instance

I'm trying to mount an EBS volume after restart. It does not work. I set the mount after reboot, in the following manner: echo "@reboot 'sudo mount $DEVICE_PATH $TARGET_PATH -O noatime,noexec'" | ...
3
votes
3answers
580 views

Why cd does not change current directory in crontab?

In my user's crontab, on a CentOS system, I have something like this: 58 12 * * * cd /home/joe/dev; echo `pwd` | logger This outputs in /var/log/messages: Feb 19 12:58:01 srv01 joe: /home/joe ...
-1
votes
1answer
65 views

crontab grep function execution [duplicate]

When I tried exection grep function in particular directory its working on that directory but when I am trying to execute using absolute paths grep is not working for example grep `date +%Y-%m-%d` ...
0
votes
1answer
99 views

CSF not adding IPs to deny file as a cron during high loads

I'm running a cron every minute to thwart brute-force attacks. awk '{print $2}' < ipkill.txt | while read ip; do #query geographical info IP address curl -o country.txt ipinfo.io/$ip ...
1
vote
3answers
384 views

Using nice scheduling priority with tar/gzip cron script

I do large backups that put huge strains on my server when using tar/gzip. I've got the task setup as a cronjob which accesses my script that handles the backup. I know that nice might be able to ...
0
votes
2answers
54 views

Cron job ignores part of trigger url

I created a cron job to trigger a url at set times, which in turn starts a product import script. But for some reason part of the trigger url with parameters is stripped away. I set the cron job like ...
0
votes
2answers
268 views

/etc/crontab file not executed

I created a dummy entry in /etc/crontab, but it doesn't get executed according to cron log /var/log/cron: Feb 7 08:20:01 localhost CROND[22781]: (root) CMD (/usr/lib64/sa/sa1 1 1) Feb 7 08:30:01 ...
-1
votes
1answer
504 views

Cron job is not working in centos 6.6

I have dedicated server having centos 6.6 and centos webpanel. Now I'm trying to set cron job from centos web panel. I had tried so many commands to run one php file each and every minute, but still ...
3
votes
1answer
597 views

Cron job as root need to sudo to another user [duplicate]

RHEL6 In root's crontab a have: * 21 * * * /root/script.sh In script.sh there is a line: /usr/bin/sudo -u jira bash -c 'cd /opt/jira/bin; ./stop-jira.sh' && echo "Jira Shut Down" >> ...
6
votes
1answer
1k views

amavis cronjob throwing an error out of nowhere

Can someone explain why amavis cronjob is suddenly trowing the following error? Cron <amavis@bee> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync rules: ...
0
votes
0answers
31 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
69 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 ...
0
votes
0answers
54 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 ...
0
votes
2answers
605 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 ...
1
vote
1answer
61 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
108 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
40 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
81 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 ...
0
votes
1answer
92 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 [ ...
3
votes
1answer
306 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
1answer
76 views

rsync: how will rsync react to a file copy from a mounted share to a remote location?

I have a task to create a passive sync between a production server and a staging server which are located in two different geographical locations. The environment is fully Linux based (CentOS/RHEL) ...
2
votes
1answer
57 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
639 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
64 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
161 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
1
vote
2answers
69 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 ...
-4
votes
1answer
216 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 ...
1
vote
1answer
90 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 ...
0
votes
2answers
123 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
30 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 ...
3
votes
1answer
301 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
1answer
67 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 ...
0
votes
2answers
92 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
48 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
48 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 ...
3
votes
3answers
33 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
75 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 ...
0
votes
1answer
55 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 ...
-1
votes
1answer
42 views

Why does nvi think I have files being editing?

I've got a couple of FreeBSD servers that throw several copies of the following error on reboot: On Wed Oct 10 15:13:16 2012, the user root was editing a file named /tmp/crontab.s00huOAZD2 on the ...
2
votes
1answer
68 views

User crontab not accessible

I cannot edit my user crontab without being superuser. I expected the following to work, but I get an error message: $ crontab -e crontabs/gauthier/: fdopen: Permission denied The following is ...
1
vote
1answer
256 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 ...
1
vote
1answer
53 views

Is there a way to check the syntax of a crontab file without actually installing it?

I know that "crontab -e" performs a syntax check before attempting to install an edited crontab. However, I am looking for a way to verify that the syntax of a crontab file is correct, even if: the ...
1
vote
1answer
448 views

“apt-get -y upgrade” in cron task runs but does not upgrade the system

This server runs Debian 7 and I'm facing a big mystery. Here are my cron tasks: $ sudo crontab -e 42 15 * * * apt-get -y update >> /var/log/my-apt-update.txt 52 15 * * * apt-get -y upgrade ...
0
votes
1answer
68 views

Cron needs restart in order to process modified /etc/crontab

I know there are many questions about this which say it will work right away. Alas, at least on our newer SLES (Suse Linux Enterprise) 11 SP3 systems, that no longer seems to be the case. (You have ...
5
votes
1answer
219 views

Cron daemon reporting “unknown user 'tomcat6'” every day since I removed tomcat

I'm running Ubuntu 12.04. Since I removed tomcat via aptitude purge the other day, I keep getting the following error from Cron daily: /etc/cron.daily/logrotate: error: tomcat6:7 unknown user ...
2
votes
3answers
319 views

cron job sending emails in a wrong charset

I have following command in a cronjob: */5 * * * * php /var/www/domain/yii rss/parse It outputs email in a wrong charset: Content-Type: text/plain; charset=ANSI_X3.4-1968 But when i launch that ...
0
votes
1answer
108 views

Unable to send external email via crontab

I'm trying to send email out from crontab. I've tried making crontab run a basic shell script, as well as specifying the actual command within the crontab. I've tried doing this with mpack and ssmtp . ...
0
votes
1answer
36 views

Send email on ldap creation

I have an LDAP server setup on a server running Debian 7 and I wanted to make it send out an email whenever a new user was created on that LDAP. I thought a cronjob would be best, but I have no idea ...
0
votes
1answer
181 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 ...
0
votes
1answer
454 views

Openshift cron not working

I'm using OpenShift and I have a shell script that is executable and can be run from the command line, however cron doesn't seem to even attempt to run it. I have placed my shell script in ...