crontab

Specifying "all odd values" in crontab?

In crontab, I can use an asterisk to mean every value, or "*/2" to mean every even value. Is there a way to specify every odd value? (Would something like "1+*/2" work?) ...

Validating Crontab Entries w/ PHP

What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I've got a PHP script that adds/removes entries from a crontab file, but want to have some way to verify that the time interval portion is in a valid format. ...

why download only for apt-get cron job

I'm putting a crontab job for updating with apt-get once a day (running Debian Lenny, there are updates almost daily). But almost all examples i've seen of this cron job invoke the -d flag. This elicits 4 questions: Why should I only download the packages and not install them? Doesn't this defeat the purpose of running it automatical...

alternative to cron?

Does anyone know of a good alternative to cron? I would like something that can be run with different time zones. ...

Crontab revision control?

I've got a few dozen Linux machines running cron and I'd like to put the crontabs in some sort of revision control system. For source control I use Mercurial (hg), so that'd be ideal, but if there's some other system that is better suited to this task I'd consider it. One aspect which is specific to my situation is that all the crontab...

How to delegate within a crontab to use another file as a crontab? aka Crontab in SVN/CVS?

Maybe theres another solution to this. I built a web app that requires 5-10 crons to keep it maintained and various intervals. I want to check-in the crontab into version control, so that it can be easily deployed to other servers. I would like to be able to put a line in the /etc/crontab file that would tell it to look into /myapp/app....

Does cron expression in unix/linux allow specifying exact start and end dates

I want to be able to configure something like this. I want to run job 'X' at 7 AM everyday starting from 29/june/2009 till 30/12/2009. Consider current date as 4/4/2009. ...

How do you run a crontab in Cygwin on Windows?

Some cygwin commands are .exe, so you can run them with the standard Windows Scheduler, but others are not .exe extension so cant be run from dos (it seems like). For example I want updatedb to run nightly. Any ideas on how to make cron work? ...

Going nuts with executing pyton script via crontab on debian!

This is what my crontab file looks like: * * * * * root /usr/bin/python /root/test.py >> /root/classwatch.log 2>&1 This is what my python script looks like: #!/usr/bin/python print "hello" The cronjob creates the log file. But it is empty. I am also pretty certain that the python file is not being executed. Appreciate any help! I...

crontab in python

I'm writing code in python for some sort of daemon that has to execute a specific action at a certain instance in time defined by a crontab string. Is there a module I can use? If not, can someone paste/link an algorithm I can use to check whether the instance of time defined by the crontab has occured in the time from when the previous ...

Why ssh fails from crontab but succedes when executed from a command line?

I have a bash script that does ssh to a remote machine and executes a command there, like: ssh -nxv user@remotehost echo "hello world" When I execute the command from a command line it works fine, but it fails when is being executed as a part of crontab (errorcode=255 - cannot establish SSH connection). Details: ... Waiting for serve...

How to create cronjob using bash

Does crontab have an argument for creating cronjobs without using the editor (crontab -e). If so, What would be the code create a cronjob from a bash script? ...

How to give permission for the cron job file?

Hi, I have set the cron tab for my site. But I have got message in my mailing id like this "Permission denied" for the script. Can anyone help me telling what may be the problem. Thanks...... ...

Why is this cron entry executed twice?

*/5 * * * * my command This entry works but every 5 minutes it get executed twice, why? In /var/log/cron it shows: Jun 16 22:20:01 Test CROND[12512]: (root) CMD (my command) Jun 16 22:20:01 Test CROND[12516]: (root) CMD (my command) So it's not from two uers. It is only entered once with crontab -e -u root The command is a php command...

Is it possible to make a bash file run as root in crontab?

I need that bash file to run periodically,and must as root. Is that kind of possible? [root@file nutch-0.9]# locate crontab /etc/crontab /etc/sysconfig/crontab /usr/bin/crontab /usr/share/man/man1/crontab.1.gz /usr/share/man/man1p/crontab.1p.gz /usr/share/man/man5/crontab.5.gz /usr/share/vim/vim71/syntax/crontab.vim [root@file nutch-0....

Run crontab with user input

Hi, i created a crontab which will run a bash script test.sh. This test.sh file requires some input from the user, and saves the user input into a variable. How do i ensure that the user input will be saved to a variable in test.sh, and when crontab runs the script i can get the output i want? for e.g i have 2 files, file1.sh and file2....

Hourly cronjob on Windows

Hi, I just setup cron on my windows dev system in order to perform an hourly run of a script. I tried to edit crontab in order to run my script hourly, sadly with no success. Could anyone pls. drop me the crontab line which will execute script.xy every hour? ...

PHP ob_* from cronjob?

Hi guys, I'm experiencing some problems with ob_* function when it runs as a cronjob: <?php function getLayout($file, $extract=array()) { if (is_file($file)) { if (count($extract) > 0) { extract($extract); } ob_start(); include $file; $contents = ob_get_contents(); ob_end_clean(); retur...

How to test things in crontab

Hi, This keeps happening to me all the time: 1) I write a script(ruby, shell, etc). 2) run it, it works. 3) put it in crontab so it runs in a few minutes so I know it runs from there. 4) It doesnt, no error trace, back to step 2 or 3 a 1000 times. When I ruby script fails in crontab, I can't really know why it fails cause when I pipe o...

how to set cronjob for 2 days?

Hi, I am using crontab command for db backup purpose,and want to take a backup once every two days. is this correct 0 0 2 * * * if wrong please tell me the correct command for setting cron for 2 days..pls help.. ...