regarding crond
Dear Experts,
I am using "CentOS release 5.3", i have certain python script (expire.py) to run daily, i put that file (expire.py) in /etc/cron.daily/expire.py To my knowledge it should automatically run the python script expire.py daily, but it is not runing since users are not getting expiry emails. But if i manually run the expire.py by: #python expire.py it works!!!! I want expire.py runs daily so that user gets expiring information daily. Need help, any help will be appreciated. Regards, Manoj |
I think cron.daily job run every day 4.2 am ensure that system is up at that time and also ensure proper permissin on python script file.
Thanks |
Hi,
Rember that running from cron you do not have the same environment as user: for example you do not have the PATH (and commands should use full path) There're various thread on this problem in this site! bye giammy |
Quote:
I have given full path inside the code. Regarding file permission i have set to #chmod 777 expire.py and to all associated file needed for expire.py to run. Is there any script or anyother method through which we can test cron.daily runing or not? Regards, Manoj |
If cron.daily is not working you can create crontab entry to run that script everyday at specified time. In addition if it does not run just that way you can explicitly call python to execute the script.
|
Quote:
you can create a script Code:
#!/bin/bash Then check if the file /TESTCRON has been created bye giammy P.S: do you already looked at logs! |
Quote:
python file name : expire.py bash script file name: expire.sh In expire.sh, [root@localhost cron.daily] vi expire.sh ---------------------------------------- #!/usr/bin/python python /etc/cron.daily/expire.py ---------------------------------------- But it is not working. Regarding crontab I have no idea. Sorry!!! Regards, Manoj |
Quote:
python /etc/cron.daily/expire.py has not full path: /usr/bin/python /etc/cron.daily/expire.py bye |
have you reloaded or restarted the crond service after adding it on /etc/cron.daily?
you can test your script if it will not generate errors by executing it directly /etc/cron.daily/filename |
All times are GMT -5. The time now is 03:28 AM. |