Crontab not working as expected
Hello,
To begin, I have made a file called 'mikecron'. In this file, there is 1 line to set a cron job for the following: */5 * * * * /home/mikie/hlds_l/cstrike/hltv_autozipdemos According to the syntax, this should be a correct line for crontab. I have a bash script called 'hltv_run': Code:
#/bin/sh Everything seems to be set up correctly however for some reason the job is not executing! If you have any idea why this might not be working, please let me know. Thanks, Mike |
Do you want crontab to execute that script every 5 minutes? If so this is what I would have used:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/mikie/hlds_l/cstrike/hltv_autozipdemos |
The "FM" on my SimplyMEPIS says that */5 means every 5 min. (Search the man page for the word "step".)
I don't think your problem is your syntax, but rather the name & location of the file -- How did you create the file & what dir did you put it in?? |
I have tested something similar on my FC4 machine and works without problems.
I created a file 'test' with this content: Code:
* * * * * echo "yes"|mail robert So either one of your scripts aren't working (x-bit not set?) or they don't have anything to do... please create some similar test script to identify if it is cron that is not working . . . Then move on to the next step (having YOUR scripts to be executed). For instance, let your own script explicitly send an e-mail to you that it is being executed, on the first line of the script. I hope this helps a bit ? Good luck Oh, and PS, your first line is not correct, it should read '#!/bin/bash' instead of '#/bin/bash' But I guess that's just a minor detail, as your machine will probably pick bash as the interpreter anyway. |
The script runs fine, I'm not too worried about that. I'm pretty sure the script is in the right spot. Is there a way to check exactly what my absolute path is from the directory with the script? I simply used $HOME and then added my directories on.
Thanks, Mike |
"I simply used $HOME and then added my directories on."
cron jobs do not run as either root or user. $HOME for cron is probably null. For sure it is not /root or /home/mikie. So your problem is probably that the absolute path to the command is correct when testing but wrong when running as cron. ------------------------- Steve Stites |
I have just tried to run by simply typing:
/home/mikie/hlds_l/cstrike/hltv_autozipdemos And the file I want does run. Any ideas...? |
Quote:
Please be so kind as to answer or I cannot help. |
All times are GMT -5. The time now is 12:03 AM. |