LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2008, 07:58 PM   #1
rajwinder
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Rep: Reputation: 15
commenting/un Cron


Fortunately or unfortunately we have around 70 cron scripts running under a linux box. Now some time during outages we have to comment all the crons and then un comment after outage.

What i tried is :

copy /var/spool/cron/usercron as /var/spool/cron/usercron_bk
and then wrote a small script to comment all the lines in the original file.

And after outage revert by copying the orginal file back.

But i think this is not a good way ? Any comments ..
 
Old 07-27-2008, 08:02 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Why not just disable cron temporarily?
 
Old 07-27-2008, 09:25 PM   #3
rajwinder
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Original Poster
Rep: Reputation: 15
well ... no doubt a pretty simple and good idea .. although this will resove my issue i guess but what if there are few that i want to keep running like few system scripts other then my app ?
 
Old 07-27-2008, 09:29 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Then move the crontabs you want disabled to a directory outside cron's crontab directory and send cron a signal to reload.

Put them back when you are ready, and re-signal cron.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 09:16 AM
VIM finding and commenting lines shamgar03 Linux - Software 3 06-06-2006 05:49 PM
commenting more than one line in VI editor newbloggy Linux - Software 1 04-18-2006 08:09 AM
php commenting, and api generation dakomoon Programming 2 12-12-2005 12:13 AM
proper commenting in C joesbox Programming 6 02-14-2005 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:33 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration