PDA

View Full Version : Can you tell what's wrong with my cron job?


lil_c09
Oct 23rd, 2007, 12:12 PM
Hi there, I've been stressing on such a small issue for the past couple hours, and I fail to see what i've done wrong.
*/1 * * * * /home/chris/.xchat2/xchatlogs/cron.pisg --silent


It's suppose to run the cron job every one minute. cron.pisg is an application that runs in terminal, but for the stupidest reason I can't get it to run.

I load the cronjob, by going to the folder where the cron job is, and type crontab crontab1 as that's the file name of the cron job. when I type crontab -l to make sure it's running, it also is there.

any help would b greately appreciated.

kc33
Oct 23rd, 2007, 12:57 PM
Remove the "/1" in the first column.

lil_c09
Oct 23rd, 2007, 03:18 PM
Remove the "/1" in the first column.

No, that didn't work.

h2o-
Oct 23rd, 2007, 03:54 PM
I would do that to see if that runs @ 5pm, then troubleshoot for something else.

00 17 * * * /home/chris/.xchat2/xchatlogs/cron.pisg --silent

kc33
Oct 23rd, 2007, 03:56 PM
No, that didn't work.

Are you getting error? Can you find anything specific in the cron log that points to a problem? Was the application launched at all? Are you able to run the exact command manually? Would cron launch the application if you scheduled it to run at a specific time?

lil_c09
Oct 23rd, 2007, 04:33 PM
Are you getting error? Can you find anything specific in the cron log that points to a problem? Was the application launched at all? Are you able to run the exact command manually? Would cron launch the application if you scheduled it to run at a specific time?

No errors when attempting to run it, can't seem to find the cron log? the application wasn't launched at all, I'm able to launch the application on it's on. and like h2o suggested, it didn't work.

[QUOTE=h2o-;5813506]I would do that to see if that runs @ 5pm, then troubleshoot for something else.

Tried that, fast fowarded the time to 5, and it didn't work :(

zoomzoom
Oct 23rd, 2007, 05:04 PM
You need to get rid of the --silent (if that is a comment line, use the # symbol).
If you want it to goto a log file, you need to pipe it out:



00 17 * * * /home/chris/.xchat2/xchatlogs/cron.pisg > /home/chris/.xchat2/xchatlogs/cron.pisg.mylogfile 2>&1

kc33
Oct 24th, 2007, 09:23 AM
No errors when attempting to run it, can't seem to find the cron log? the application wasn't launched at all, I'm able to launch the application on it's on. and like h2o suggested, it didn't work.

Have you checked if cron daemon is running at all?

If it is, try to schedule run of a simple command such as 'date > /home/chris/date.txt'.

siriuskao
Oct 24th, 2007, 11:57 AM
Change it to


*/1 * * * * root /home/chris/.xchat2/xchatlogs/cron.pisg --silent


Specify a user if you are editing /etc/crontab directly. Leave the username off if you are editing user's crontab via crontab -e

oh, I am assuming you've already checked obvious things like cron daemon is running and command is correct. If it is incorrect, you should get error output.

lil_c09
Oct 24th, 2007, 01:35 PM
Have you checked if cron daemon is running at all?

If it is, try to schedule run of a simple command such as 'date > /home/chris/date.txt'.

Yessir, it worked. I will try to see exactly what i did wrong.

lil_c09
Oct 24th, 2007, 01:48 PM
Urgh, nope. Still not working. An application that is run in terminal is allowed to be set up to run every minute, as a cron job correct? I mean, If I could get the txt to output the date as easily as I just did, then I fail to see why I can't get my cronjob to run the program.

kc33
Oct 24th, 2007, 04:00 PM
Urgh, nope. Still not working. An application that is run in terminal is allowed to be set up to run every minute, as a cron job correct? I mean, If I could get the txt to output the date as easily as I just did, then I fail to see why I can't get my cronjob to run the program.

Try to locate cron log file. The cron man pages should have the file location. Also, please clarify what "application that is run in terminal" meant. Is cron.pisg a shell script that launches other scripts? May be the problem is down stream.