LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 04-02-2018, 10:43 AM   #1
mike_bo
LQ Newbie
 
Registered: Apr 2018
Posts: 2

Rep: Reputation: Disabled
Question How disable a task for cond


I have a pretty simple question:

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?
 
Old 04-02-2018, 11:13 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,970

Rep: Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334
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.
 
Old 04-02-2018, 11:17 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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.
 
Old 04-02-2018, 11:33 AM   #4
mike_bo
LQ Newbie
 
Registered: Apr 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks. That was quick. Kudos.

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?
 
Old 04-02-2018, 11:41 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
can you please show us the output of:
Code:
crontab -l
 
Old 04-02-2018, 12:23 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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.
 
Old 04-02-2018, 01:18 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
/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?

Last edited by scasey; 04-02-2018 at 01:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
launching a task from cli and "divorcing it from terminal task wufo Linux - General 6 02-11-2011 11:32 AM
Disable crontab task TalkingMarble Linux - Newbie 5 08-07-2008 09:15 AM
Disable right click on task bar Mr.J Ubuntu 1 07-06-2008 04:28 AM
Need Iptables command for a particular cond. shipon_97 Linux - Security 3 03-31-2006 01:57 AM
Redirect cond mail ? michaelsanford Linux - Newbie 2 07-23-2005 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration