The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
temporarily suspend crontab Paul.S Shell Programming and Scripting 7 09-02-2009 12:18 PM
Suspend in opensolaris FloridaBSD SUN Solaris 2 10-25-2008 03:01 PM
suspend a process superuser84 UNIX for Advanced & Expert Users 6 03-18-2008 09:36 PM
Suspend Cron job temprory pankajkrmishra Shell Programming and Scripting 4 08-14-2006 09:18 AM
suspend a process piou78 Shell Programming and Scripting 7 06-03-2005 10:08 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-21-2009
EAGL€ EAGL€ is offline
Registered User
  
 

Join Date: Aug 2009
Location: istanbul
Posts: 46
Suspend of crontab temprorarily

Hello Friends,

I would like to find out if there is a way to suspend crontab script? I need to suspend the scheduling of crontab scripts in case of an alarm and when alarm ends need to start them again automaticaly, could you suggest me a method?

one of participiant of the forum with name aigles said:

To suppress all jobs from crontab :

Code:
crontab -l > cronfile.dat   # Save actual crontab file
crontab -r                  # Remove crontab file

To restore all jobs :

Code:
crontab < cronfile.dat

This is a solution but after restoring process could crontab reschedule the tasks?


Regards
  #2 (permalink)  
Old 08-21-2009
panyam panyam is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Posts: 474
Yes , it will . I mean the crontab will start scheduling the tasks that are all suppose to execute at the current time.
  #3 (permalink)  
Old 08-21-2009
EAGL€ EAGL€ is offline
Registered User
  
 

Join Date: Aug 2009
Location: istanbul
Posts: 46
Quote:
Originally Posted by panyam View Post
Yes , it will . I mean the crontab will start scheduling the tasks that are all suppose to execute at the current time.
Thanks for reply. After i restored tasks in crontab, tasks will be reloaded with same execution times, not different time right? And it might be really weird question but is there a way to set the execution times of crontab tasks automatically or cant we talk about automization when crontab is not alreadly in use?
  #4 (permalink)  
Old 08-21-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,945
It depends on your operating system. If you are using GNU/Linux and it has anacron, this may not be the case.
  #5 (permalink)  
Old 08-21-2009
EAGL€ EAGL€ is offline
Registered User
  
 

Join Date: Aug 2009
Location: istanbul
Posts: 46
Im using Solaris10 T-1000, cron run, should read about it. thanks
  #6 (permalink)  
Old 08-21-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,586
Quote:
To restore all jobs :
Code:

crontab < cronfile.dat
Why < ?
There is no need... the syntax is crontab <filename>
This said on solaris you remove your cronfile to desactivate the cron jobs and recall using your cronfile works fine,,, but I know some paranoďds who edit and comment out all entries....


All the best
  #7 (permalink)  
Old 08-21-2009
EAGL€ EAGL€ is offline
Registered User
  
 

Join Date: Aug 2009
Location: istanbul
Posts: 46
Thanks a lot VBE, things are clearer on my mind. Besides i can try things in test machines so if i get something very useful i will share it with all.

Regards
Reply

Bookmarks

Tags
crontab, reschedule, suspend

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0