January 21st, 2013, 03:09 PM
Join Date: Sep 2009
Time spent in forums: 6 h 20 m 57 sec
Reputation Power: 0
CentOS Cronjob Assistance
I am attempting to set up a cronjob on my new CentOS server, but I am having trouble getting it to work. I logged in as su and edited the crontab file to read the following
# For details see man 4 crontabs
40 * * * * python /home/hojoff79/onlinetest.py
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
with the only line I added being the 40 * *.... I also ran the "/sbin/service crond start" command to start cronjobs, and it executed without return any errors.
I have run that exact line "python /home/hojoff79/onlinetest.py" from the etc folder where crontab is saved, and it executed perfectly, so I do not understand why it won't execute automatically.
Also, I am self taught so a lot of my programming is trial and error, but I am not sure how to see a log of how a crontab executed to see if it is giving any errors or not, is there a log somewhere I could look at to hopefully get an idea of why is is not working?