Sponsored Content
Top Forums Shell Programming and Scripting Disabling and enabling the cron Post 302643223 by bakunin on Friday 18th of May 2012 05:13:57 PM
Old 05-18-2012
brianjb is correct. Instead of stopping/starting the cron itself you can stop/start all the cron jobs.

It is possible to edit the crontab file via crontab -e, but there is an even easier way:

In most systems the crontab for each user resides in a file (for instance in AIX it is /var/adm/cron/crontab/<username>). Move these files somewhere else to disable all cron jobs and move them back to reenable them.

CAUTION: the crontab command issues a refresh signal to crond after every change of a crontab file (this is why the file is not edited with a text editor). If you move the crontab files you will have to send a a signal 1 to crond to to make it aware of the changes.

Code:
kill -1 <PID-of-crond>

I hope this helps.

bakunin
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ports Disabling

I will want to disable all the ports not needed in my UNIX. If I put a # sign at the beginning of the line of the port name I want to disable in /etc/services.... that's all????? Or I need to do anything else to disable a port???? (1 Reply)
Discussion started by: rrivas
1 Replies

2. UNIX for Dummies Questions & Answers

disabling telnet

how do i disable the telnet (2 Replies)
Discussion started by: rmuhammad
2 Replies

3. Shell Programming and Scripting

enabling/disabling an oracle trigger

hi, i want to disable and then enable an oracle trigger through shell script. Please tell me how it can be done? (1 Reply)
Discussion started by: ss_ss
1 Replies

4. Shell Programming and Scripting

disabling and enabling the crontab

Hi All, I need disable all the crontab job in the cron and then later have to enable the crontab job by shell scripting. or otherwise disable the cron and enable cron again by means of unix shell scripting. Please can you one help me out in this. Thanks in Advance. Regards, Sindu (2 Replies)
Discussion started by: indira_s
2 Replies

5. Solaris

Disabling sendmail

Hello everyone, can anyone tell me how to disable sendmail on solaris 10? I seem to have the sendmail process from hell. Did an SVCS | grep for mail and disabled the 2 processes it threw up. But something is still respawning sendmail (if I kill it manually) and it's doing the usual... (2 Replies)
Discussion started by: callmebob
2 Replies

6. UNIX for Dummies Questions & Answers

How to Disabling cron for few hours each day

Hi Is there any way to disable cron adhoc ? I want to run a script for every one minute between 04 to 00 hours will the below serves my purpose ? 01 04-00 * * * <your script> (1 Reply)
Discussion started by: rakeshkumar
1 Replies

7. AIX

Disabling cron after NIM restore

Hi Guys, We normally have a backup and restore nightly on our Prod machines. We do this via customized script and all unattended. The dilemma that I'm having is the disabling of the cron after the restore. I created a nim script to disable the cron after the restore has been completed. But... (6 Replies)
Discussion started by: kaelu26
6 Replies

8. Hardware

How disabling GPU?

Hi All I'm find out a way to disable the DGD: AMD Radeon HD 7470M on my Ubutu 16.04.2 LTS because radeon open source module is not capable to support this GPU and consequence the boot is very slow. I have tried serveral way with pci-stub.ids in the grub menu but not work. In general how... (11 Replies)
Discussion started by: _Fabio_79
11 Replies
CRON(8) 						      System Manager's Manual							   CRON(8)

NAME
cron - daemon to execute scheduled commands (Vixie Cron) SYNOPSIS
cron DESCRIPTION
Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format (see crontab(5)). Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When execut- ing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the Crontab(1) command updates the modtime of the spool directory whenever it changes a crontab. SEE ALSO
crontab(1), crontab(5) AUTHOR
Paul Vixie <paul@vix.com> 4th Berkeley Distribution 20 December 1993 CRON(8)
All times are GMT -4. The time now is 07:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy