LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   crontab's not working (https://www.linuxquestions.org/questions/linux-software-2/crontabs-not-working-127148/)

herc 12-19-2003 01:10 AM

crontab's not working
 
Ok, I have inputted cronjobs correctly but it doesn't seem to do them, what might be wrong? (first time using cron)

Quote:

* */4 * * * /home/herc/pisg-0.49/pisg >/dev/null 2>&1

* */4 * * * /home/herc/pisg3/pisg >/dev/null 2>&1

*/10 * * * * /home/herc/eggdrop/script.tcl >/dev/null 2>&1

david_ross 12-19-2003 02:25 PM

Well you are pointing the output to /dev/null. Try putting it to a file then you may get an idea of what is wrong.

camelrider 12-19-2003 06:43 PM

Also..If you type "mail" at a prompt in the home directory of the user whose crontab you're using you may find that cron has sent you some messages. (man mail)

herc 12-22-2003 10:46 AM

Hmm, I want to run pisg once in four hours and a tcl script once every 10 min, so are these right?

* 4 * * * /dir/pisg
10 * * * * /dir/something.tcl

And is it enough to crontab file.txt which has those included?

herc 12-22-2003 11:08 AM

btw, can you change the editor for crontab?

TheOther1 12-31-2003 09:01 AM

Quote:

Originally posted by herc
Hmm, I want to run pisg once in four hours and a tcl script once every 10 min, so are these right?

* 4 * * * /dir/pisg
10 * * * * /dir/something.tcl

And is it enough to crontab file.txt which has those included?

If you want to run psig every 4 hours (on the hour) then it should look like this:
0 0-23/4 * * * /dir/psig
OR:
0 0,4,8,12,16,20 * * * /dir/psig

What you have says run every minute during the 4 AM hour.

Format is:
[MIN] [HOUR] [DAY OF MONTH] [DAY OF MONTH] [DAY OF WEEK] COMMAND


Looks like you tcl is running 10 minutes after every hour of every day. Should be:
0-59/6 * * * * /dir/something.tcl
OR:
0,10,20,30,40,50 * * * * /dir/something.tcl

You get your crontab file by running crontab -e
That will open vi and you enter your commands, one per line. So in your case:

#Always a good idea to comment for future troubleshooting
0 0-23/4 * * * /dir/psig
#More comments...
0-59/6 * * * * /dir/something.tcl

Hope that helps!

ugge 12-31-2003 09:10 AM

Your first crontab seems correct.
To track down any errors remove >/dev/null 2>&1
This way you will have errors sent by mail to the user for which this crontab belong.
Check the mail and you should be a piece on the way.


All times are GMT -5. The time now is 01:18 PM.