CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have an Asterisk system running on Centos (6 I believe), and I had set up a crontask so that the computer would reboot every morning (I had some issues with connectivity). Now that is fixed and I want to see if I can keep the Asterisk box running continuously. I have commented out ("#") the crontab line and saved it (as Admin), but my computer keeps rebooting at 4 ...
Do I need to do anything else other than commenting out the line?
I would say you commented out another line, not the relevant one. Or it is configured in a different way. But without knowing the system hard to say more.
in addition, where did you create the task? If it is a system cron job i.e /etc/crontab then the system should automatically pick up the changes. If it is a root cron job and you edited /var/spool/cron/root directly then you need to restart crond.
To be honest I am not sure how I set that up. It's been a while ...
But commenting out the line in /etc/crontab does not do anything (there is only one line in there, so no chance I commented out the wrong line).
But I see the same line in the /var/spool/cron/root file (not commented out). I renamed the file to root_old, but I am not sure if that would do it or not. Is this file created automatically from some other configuration file, so that it comes back when the computer is rebooted, or will my renaming work?
You can look at the cron log file to see where/what i.e. user or system is running your task.
/var/log/cron
If you manually edited/renamed the /var/spool/cron/root file instead of using crontab -e (as root) the system would not pickup the changes until you restart crond.
/var/spool/cron/root is viewed with crontab -l and edited with crontab -e (using EDITOR...usually vim, tho that's configurable)
...michaelk's suggestion is good...'tho you say you've already seen the line in root's crontab, yes?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.