hadi motamedi
2009-Oct-28 05:07 UTC
[CentOS] Inquiry:How to make crontab job permanent even after server reboot?
Dear All Please be informed that I have an CentOS 5 server and I need it to be automatically rebooted at pre-specified times . To this end , I tried to set it as its crontab job as the followings : #crontab -e 30 15 * * * reboot It got through but after the server first reboot the crontab job disappeared . So I tried to set it in another way , as the followings : set the cron list in /tmp/temp add the following lines to /etc/rc.local : crontab /tmp/temp But still the crontab job will disappear after the server first reboot . Can you please do me favor and let me know how can I make the crontab job permanent on my CentOS server even after server reboot ? Let me thank you in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20091028/52bf17d0/attachment-0002.html>
John R Pierce
2009-Oct-28 05:16 UTC
[CentOS] Inquiry:How to make crontab job permanent even after server reboot?
hadi motamedi wrote:> Dear All > Please be informed that I have an CentOS 5 server and I need it to be > automatically rebooted at pre-specified times . To this end , I tried > to set it as its crontab job as the followings : > #crontab -e > 30 15 * * * reboot > It got through but after the server first reboot the crontab job > disappeared . So I tried to set it in another way , as the followings : > set the cron list in /tmp/temp > add the following lines to /etc/rc.local : > crontab /tmp/temp > But still the crontab job will disappear after the server first reboot > . Can you please do me favor and let me know how can I make the > crontab job permanent on my CentOS server even after server reboot ? > Let me thank you in advance >crontab -e /should/ be editing the file /var/spool/cron/$USER and crond reads /var/spool/cron/* to decide what to do. do you have scripts that are wiping out these files on reboot? or is /var/spool on a transient (non-persistent) storage ?