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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to disable RIP and enable EGP stringman Security 3 02-19-2008 03:31 PM
Disable/Enable HP print services SCO OS 5 sighbrrguy UNIX for Advanced & Expert Users 4 01-09-2008 08:33 AM
SSH enable, Telnet disable ... ArabOracle.com SUN Solaris 14 03-02-2007 12:27 PM
Enable/Disable rlogin and rcopy XP_2600 SUN Solaris 3 10-08-2006 06:52 PM
Enable and disable ttyS0 josramon Linux 1 12-01-2003 07:58 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-12-2007
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Enable & disable cronjob

Hi All,

I am new to cronjob and need some guidance on this.

1) How do i enable a cronjob ?
Can it be done by "crontab mycronfile" or "crontab -e mycronfile"

2) How can i disable the cronjob?
Can deleting of the "mycronfile" disable the cron or do i need to perform "crontab -r mycronfile" ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
1) yes, yes

2) crontab -r
Reply With Quote
  #3 (permalink)  
Old 09-13-2007
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Hi,

Is there any way that i can check whether the cron has been disabled or enabled ?
Reply With Quote
  #4 (permalink)  
Old 09-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
If you mean the cron subsystem then do a check of the process list and see if cron is running. Otherwise it depends on your operating system.


If you mean your tasks, then do "crontab -l", if nothing is listed that does not start with # then you have nothing scheduled.
Reply With Quote
  #5 (permalink)  
Old 09-19-2007
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Hi ,

I can't disable my cron. Can you help ?
Below is the error msg

$ crontab -r cronline
crontab: you are not a valid user (no entry in /etc/passwd).
Reply With Quote
  #6 (permalink)  
Old 09-19-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
1. What about

echo >empty
crontab ./empty

2. Are you listed in /etc/passwd ?

3. What are the rights to the /etc/passwd file? eg "ls -ld /etc/passwd"

4. What is the result of "id"?
Reply With Quote
  #7 (permalink)  
Old 09-19-2007
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Does "crontab -r" remove all cronjobs regardless of which user id u are using ?
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0