The hourly configured cronjob asl started to exit with return code 127 since one day (after run of apt-get update; apt-get dist-upgrade).  Now I'm receiving hourly reports like:  run-parts: /etc/cron.hourly/asl exited with return code 127   Where does it come from? Config file looks quite fine.  /EDIT: I saw the "duplicate thread". Unfortunately there is only that one small chapter about cron.hourly scheduled jobs. All the logs files etc. are not mentioning anything. Executing the cron step by step shows following error:  root@s01:/etc/cron.hourly# /var/asl/bin/aum -u Checking versions ...   Updating Web Application Firewall to 201608111803: updated        [PASS] Restarting Apache ...  Generating report ...   Finished ------------------------------------------------------------------------------- Errors were encountered:  L CODE SOURCE                        MESSAGE - ---- ----------------------------- ------------------------------------------ 2 9901 ASLCommon::cmd_system         ERROR: '/bin/cp -af /var/asl/rules/modsec/                                      template-* /var/asl/data/templates/ &gt;/dev/                                      null 2&gt;&amp;1 (1)'
589
This is a  about using cron &amp; crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.
16152
I want to edit my crontab file to schedule a script. Where do I find it?
51077
I run a job every minute to reindex my site's content.   Today, the search engine died, and when I logged in there were hundreds of orphan processes that had been started by cron.  Is there another way using some kind of existing software that will let me execute a job every minute, but that won't launch another instance if that job doesn't return (i.e. because the search engine process has failed)?
92861
I'm trying to get execute a cron job everyday at noon but i can't get it to run. To test it i even tried something like a simple create command but it never runs, it seems as if the file isn't even used. I also can't see anything going wrong in the log.  0 12 * * * mkdir /path/to/folder   So is there something wrong with this line or should i look elsewhere?  I created the crontab as root with crontab -e
43827
The following crontab does not work:  # TEST LINE DOES DOT RUN */1 * * * * /bin/echo 'test '`/bin/date +%Y-%m-%d` &gt;&gt; /tmp/test   I also tried starting it with:  SHELL=/bin/bash   Update: I thought the backtick characters ` were the villains, but as the answer below clarifies the percentage % was the culprit!
18461
I have a script that works when I run it from the command line, but when I schedule it with cron I get errors that it cannot find files or commands.  My question is twofold:   When I schedule a cron job using crontab -e, does it use my user ID as the basis for its permissions?  Or does it use a cron user ID of some sort and its related permissions? When a cron job is launched, what is the working directory?  Is it the directory where I specify the script to run, or a different directory?   Here is my cron job:  15 7 * * * /home/xxxx/Documents/Scripts/email_ip_script.sh   Here is the actual script:  vIP_ADDR="`curl automation.whatismyip.com/n09230945.asp`" echo "$vIP_ADDR" sed "s/IPADDR/$vIP_ADDR/g" template.txt &gt; emailmsg.txt ssmtp XXXXX@gmail.com &lt; emailmsg.txt   Here are the errors I get when I view the mail message produced by cron:  sed: can't read template.txt: No such file or directory /home/xxxx/Documents/Scripts/email_ip_script.sh: line 15: ssmtp: command not found   It cannot find the template.txt but it resides in the same directory as the script.  It also cannot run ssmtp, but I can as my user.  What am I missing to get this to work properly?
63274
The first noncomment line in a legacy crontab file begins with five asterisks:  * * * * * ([a_command]) &gt;/dev/null 2&gt;&amp;1   The authors are gone, so I do not know their intent.  What does all-wildcards mean to (Solaris 8) cron?  The betting here is either run once, run continuously, or run never, which is unfortunately broad.  If you are wondering about the comment line preceding this, it is "Do not delete."  Note: This cron file is working. This question is not a duplicate of a question about broken cron files or cron files which require troubleshooting.
98969
This is happening only since last update (or one in the last day or so). Seeing it on multiple sites, and quit => reopen didn't work, nor did a restart.   EDIT:  As pointed out by @Anthony, this appears to be a dupe of , but since that's marked , it might be a different bug causing the same output?  I'm happy to self-close as dupe, but want to make sure we ID the new cause.
92759
I'm trying to ensure a script remains running on a development server. It collates stats and provides a web service so it's supposed to persist, yet a few times a day, it dies off for unknown reasons. When we notice we just launch it again, but it's a pain in the rear and some users don't have permission (or the knowhow) to launch it up.  The programmer in me wants to spend a few hours getting to the bottom of the problem but the busy person in me thinks there must be an easy way to detect if an app is not running, and launch it again.  I know I could cron-script ps through grep:  ps -A | grep appname   But again, that's another hour of my life wasted on doing something that must already exist... Is there not a pre-made app that I can pass an executable (optionally with arguments) and that will keep a process running indefinitely?  In case it makes any difference, it's Ubuntu.
26584
I have this cronjob set :  * * * * * /usr/bin/systemctl suspend   And it is not working. But I can run it in a shell and it works. I don't understand what could be not working.  EDIT Redirecting error output to /tmp/error gives this :  Failed to issue method call: Access denied Failed to issue method call: Access denied   My question is then : Are cronjobs run as a special user (cron for example), which would explain that my user can run the command, but not cron itself?  Additional explanation :   This is a minimal example to show a problem I have in a script (that makes more sense than the single command provided here) systemctl is part of systemd. I think reboot, shutdown, suspend are working with a non-root user with systemd. Anyway, it is working on my system. Finally, I use Arch Linux and /bin, /usr/sbin, /sbin are all symlinks to /usr/bin.
97501
I want to run a PHP script from cron. I setup cron with:  */1 * * * * php  /var/www/html/cron/cron_job.php   And I can see it in crontab -u root -l, but the job is not executed. It also doesn't work when I run the command directly from the command line like this:  &lt;?php  /var/www/html/cron/cron_job.php   I tried many answers related to cron but nothing worked. For example:  /usr/local/bin /var/www/html/cron/cron_job.php /usr/local/bin/php /var/www/html/cron/cron_job.php sudo php -f /var/www/html/cron/cron_job.php   The testing php script (cron_job.php) is:  php file_put_contents  ('test.txt',"test content\n",FILE_APPEND);     File permissions are all OK and it is working when run in the browser or when opening a terminal in /var/www/html/cron/ and running php cron_job.php.  As requested in the comments, if I append 2&gt; /tmp/php.log to php /var/www/html/cron/cron_job.php use  a script with a syntax error and try to run (php /var/www/html/cron/cron_job.php 2&gt; /tmp/php.log) from menu terminal, then the error log gets the error message.
92777
I have a backup script which I need to run at a particular time of a day so I am using cron for this task and from within cron am also trying to redirect the output of backup script to a logfile.  crontab -e  */1 * * * * /home/ranveer/backup.sh &amp;&gt;&gt; /home/ranveer/backup.log   In the above cron entry I am redirecting both stderr and stdout to a log file.  The above cron job executes fine according to syslog  and it performs the task mentioned in the backup.sh file but it doesn't write anything to the log file.  /var/log/syslog  Oct 19 20:26:01 ranveer CRON[15214]: (ranveer) CMD (/home/ranveer/backup.sh &amp;&gt;&gt; /home/ranveer/backup.log)   When I run the script from cli it works as required and output is written to a log file  ranveer@ranveer:~$ ./backup.sh &amp;&gt;&gt; backup.log  ranveer@ranveer:~$ cat backup.log Fri Oct 19 20:28:01 IST 2012 successfully copied testdir test.txt successfully copied ------------------------------------------------------------------------------------- ranveer@ranveer:~$    So, why the output of file is not getting redirected to the file from within cron.
116444
I have tried to make this task for abacron:  dm@dm-system:~$ cat /etc/anacrontab  # /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details.  SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root LOGNAME=root  # These replace cron's entries 1   5   cron.daily  run-parts --report /etc/cron.daily 7   10  cron.weekly run-parts --report /etc/cron.weekly @monthly    15  cron.monthly    run-parts --report /etc/cron.monthly @daily 5 /home/dm/Devel/btsync &amp;&amp; notify-send "Btsync loaded (pid `pidof btsync`)" "Link &lt;a href='http://0.0.0.0:8888/gui/'&gt;here&lt;/a&gt;."   this command well done from my xubuntu terminal   /home/dm/Devel/btsync &amp;&amp; notify-send "Btsync loaded (pid `pidof btsync`)" "Link &lt;a href='http://0.0.0.0:8888/gui/'&gt;here&lt;/a&gt;."   but when i started my notebook i saw in /var/syslog:  Aug 14 10:49:06 dm-system anacron[904]: Anacron 2.3 started on 2014-08-14 Aug 14 10:49:06 dm-system anacron[904]: Invalid syntax in /etc/anacrontab on line 14 - skipping this line Aug 14 10:49:06 dm-system cron[841]: (CRON) INFO (pidfile fd = 3) Aug 14 10:49:06 dm-system cron[998]: (CRON) STARTUP (fork ok) Aug 14 10:49:06 dm-system cron[998]: (CRON) INFO (Running @reboot jobs) Aug 14 10:49:07 dm-system anacron[904]: Will run job `cron.daily' in 5 min. Aug 14 10:49:07 dm-system anacron[904]: Jobs will be executed sequentially Aug 14 10:54:04 dm-system anacron[904]: Job `cron.daily' started Aug 14 10:54:05 dm-system anacron[2616]: Invalid syntax in /etc/anacrontab on line 14 - skipping this line Aug 14 10:54:05 dm-system anacron[2616]: Updated timestamp for job `cron.daily' to 2014-08-14
47615
We have a job that is set to run Monday thru Friday. Up until two weeks ago, it ran fine 5 days a week. For the last two weeks it has failed on Monday. I am unable to locate where to find the point of failure.   ### Example Scripts 0 2 * * 1-5 /admin/scripts/example.exp 1&gt;/dev/null 2&gt;&amp;1   We run AIX 7.1.  I've looked in the /var/log/ and there is no cron file there. Looking for advice to add to this so we can troubleshoot.   I found that the log is located in /var/adm/log. Further we are getting this error repeatedly ever since this date/time. How do I clear this max limit?  c queue max run limit reached Fri Nov 25 21:52:00 2016 ! rescheduling a cron job Fri Nov 25 21:52:00 2016
32645
I want to verify that my cron job is executing and at what time.  I believe there is a log for my sudo crontab -e jobs, but where?      I searched google and found recommendations to look in /var/log (in which I do not see anything with 'cron' in the name) and to edit the file /etc/syslog.conf which I also do not have.
100712
I created a cron job using * */2 * * * schedule. Can anyone tell me what schedule this refers to?  I guess it should execute every 2 hours, but it seems to execute every minute.
81580
I am trying to make a crontab that makes a new .tar file each minute every business day by using the following code:  */1 * * * 1,2,3,4,5 tar -cf /home/user/Archiv/$(date +"%Y%m%d%H%M").tar /home/user/Textverarbeitung/ -P   This doesn't work. Why?