I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few seconds? So, is there any way to simulate the execution of a cron job / start a cron job manually, but with the same behaviour it would have when being run automatically by cron?
122856
I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?    EDIT: (from the comments) I know the command works fine when enter it in shell (my shell), but I want to know if it works correctly when cron runs it, it could be affected by ENV or shell specific stuff (~ expansion) or ownership and permission stuff or ...
58473
How can I make crontab email me with the output of its jobs? I have MAILTO=redacted@yahoo.com.au above the jobs, but it doesn't work.  I know I need to use something like Postfix or Sendmail but for the life of me I cannot find out how to achieve this. I've searched and searched for a simple guide on setting up Postfix but they're all insanely complicated and expect you to be setting up a whole server to send and receive email and to know all the terms (like, what is a domain name for outgoing emails?).  All I want to do is have crontab email me. Why is this so difficult??  Additional Info:  My crontab file looks like this:  MAILTO=redacted@yahoo.com.au 1 0 * * * ~/Desktop/toskymesh.sh 59 6 * * * ~/Desktop/tooptus.sh 0 3 * * * snapraid sync   More Additional Info:  The output of ps -ef | grep '[s]endmail'  root 6840 1370 0 10:26 ? 00:00:00 sendmail: MTA: accepting connections   I know for sure cron is working, but I'm testing the mail command with echo Test | mail -s Test redacted@yahoo.com.au anyway.
104641
I have a deployment script, it must add something to a user crontab (trigger a script that clean logs every XXX days), however this must only be done during the first deployment, or when it needs to be updated.  (I can run xxx.py deploy env or xxx.py update env)  so I have to do this:  Check if my cronJob already exist Put my cronJob if it does not already exist or update my cronjob if one of the parameter of the command is different   I don't see how to add/check/remove something to the crontab without using crontab -e or editing the crontab file (download it, rewrite it, re-upload it)  PS : this is a user specific cronjob, "webadmin" is going to do it and he should not use sudo to do it.
74016
Trying to set up a daily cron job to shut down a server.   One source suggests editing /etc/crontab  Another suggests crontab -e (with sudo)  I tried the latter, and my process did not run (if I recall, it was 30 23 * * * shutdown -h)   I also note that in the nano editor, it was working on a .tmp file? (top of nano says: /tmp/crontab.9zeTNt/crontab )  What is going on? How can I fix this?
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?
85506
I have a IOS stimulator created in MAC. So for our project testing i need to run the test for every 15mins. Can someone help me create a Cron job for this?  The command i enter to run IOS script is cd /Users/Downloads/uiautomation/ ./runthis.sh
62982
I have a cron job that runs every minute on an Ubuntu 12.04 box  $sudo crontab -e * * * * * mylogin /pathto/file.sh &gt; /log/filelog   If I run file.sh, the bash script does some stuff and echos out runs:  $ ./file.sh  runs   If I check the log of cron tab it shows that the job is running:  Jul 10 12:41:01 localhost CRON[1811]: (root) CMD (mylogin /pathto/file.sh &gt; /log/filelog) Jul 10 12:41:01 localhost CRON[1810]: (CRON) info (No MTA installed, discarding output) Jul 10 12:42:01 localhost CRON[1813]: (root) CMD (mylogin /pathto/file.sh &gt; /log/filelog)   However, the script is not running. It is not doing it's work and not echoing runs to /log/filelog.  $cat /log/filelog  #shows nothing   What other steps can I take to debug this problem?
42307
To my understanding, this is the default configuration of /etc/crontab:  # m h dom mon dow user  command 17 *    * * *   root    cd / &amp;&amp; run-parts --report /etc/cron.hourly 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily ) 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly ) 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )   Why were these specific times chosen for the default entries?  At first I assumed that they are somewhat randomized on installation to even out the system load, but that doesn't seem to be correct.
24002
I need my script to be executed a minute after each reboot. When I apply @reboot in my crontab it is too early for my script - I want the script to be executed after all other tasks that are routinely run on reboot. How might I run the script sometime after reboot?
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.
104065
The Case: I need to run some commands/script at certain intervals of time and for this I have two options:  set up a cron-job implement a loop with sleep in the script itself.  Question: Which is the better option from resource consumption point of view, why? Is cron the better way? Does cron use some kind of triggers or something making it efficient over the other? What procedure does cron use to check and start the jobs?
63527
I have a simple periodic cron task that must run as root. I want to use Zenity (or similar) to display a GUI informational dialog to user 1000 (or logged in user or all users) when the cron task finishes.   I'm looking for a simple, easy, quick solution. I'll adapt to the requirements of such a simple solution.  Here's where I am so far. My bash script works fine if run manually, but when Anacron runs it, nothing happens and I see Gtk-WARNING **: cannot open display in the logs. I hoped it would display my dialog to the user after being run by cron.  I realize (after reading related questions) that cron needs to be decoupled from the GUI. If user 1000 is not logged in, I could take one of several options:   do nothing (possibly acceptable because I want to keep it simple) display the dialog with completion message to the user when they log in next time (best) display some other type of notification (NOTE: the computer is a desktop system without a mail server installed)   I found these related questions: x11 - Anacron job complains "Gtk-WARNING **: cannot open display" - Unix &amp; Linux Stack Exchange   shell - How to pass data outside process for zenity progress? - Unix &amp; Linux Stack Exchange   Example Code (from other question which is essentially the same as mine):  #!/bin/bash # Backs up the local filesystem on the external HDD  sleep 60  DISPLAY=:0.0  zenity --question --text "Do you want to backup? Be sure to turn on the HDD." if [ $? -ne 0 ]     then exit 1 fi  *Do backup stuff here*   Error:  (zenity:9917): Gtk-WARNING **: cannot open display:  run-parts: /etc/cron.daily/backup-on-external exited with return code 1   (I'm running Kubuntu, so a KDE solution would be even better than Zenity, but I already installed Zenity, so I can keep using 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)?
89138
I am running a half dozen different cron jobs from my hosting at Hostmonster.com.  When a cronjob has been executed I receive an email with the output of the script.  The email comes in the format of:  From: Cron Daemon Subject: Cron  /ramdisk/bin/php5 -c /home5/username/scheduled/optimize_mysql.bash   The problem with this is that the subject of the email makes it very hard to read which cronjob the email is pertaining to.  Is there a way to modify the subject of a cronjob email so that it's easier to read?  For example:   From: Cron Daemon Subject: Optimize MySQL Database
55825
How to execute a script periodically like crontab does but without using crontab?  Please note this that the executed script should not fire with another script and schedule it with 'sleep' command, what I expect to have same functionality as crontab but it should not be present in crontab list and should not be stop when terminal or session ended,   crontab exactly but without croning it.
103127
I have an automated script that pulls backups from my website to my local computer. This script could fail; once my server was down, another time I accidentally moved my script.  How do I make Windows Task Scheduler tell me with the script fails (or doesn't run/not found)?  I don't care if a prompt comes up, an email or something that appears on my desktop. I want to be notified if something goes wrong. On my server, crontab emails me about errors - which is great. I want something like that on my windows 7 local computer.
73722
Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's . I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for:   Ability to register task (class/method) to be called at given intervals. Ability to specify whether a given task can be run multiple times (potentially long running methods should not be run multiple times in certain cases). All registered entries/methods could be run in parallel (jobs are backgrounded so that they do not block other timed tasks). Ability to set a timeout for a given task. Ability to update job control dynamically, so for instance you could disable some tasks or change their frequency without code changes.   I know it is a lot to ask, but it seems like a useful batch of features and I thought someone might have put together some portion of them.  If this or some portion of this does not already exist, any pointers to putting one together or an open source project that has a reasonably featureful implementation of some subset of these?