Unix/Linux OS/Swapping crontab

Advertisement


Question
Hello,

I have one requirement where I need to stop few jobs from running during maintenance window, and then reschedule them again after maintenance is complete. This is done generally every other week.

Currently I just comment out the jobs which are to be stopped in crontab, and then uncomment them when maintenance is complete.

Is there any way we can create 2 files for the jobs in crontab, 1 with normal schedule and other considering maintenance window, and then swap them as and when needed?

Thanks
Sue.

Answer
Hi.

Sorry for late response, health problems...

Anyway, the command "crontab" can take as an argument a file to install, so yes, you could have two separate files, nicely maintained and switching them around. See man pages for "crontab".

Nix.

Unix/Linux OS

All Answers


Answers by Expert:


Ask Experts

Volunteer


nix

Expertise

UNIX, programing, C, C++, awk, shell scripts, Web, HTTP, Apache, firewall, AltaVista firewall, E-Mail, sendmail, IMAP4 POP3, DNS, NTP, system administration, TCP/IP, security

Experience

UNIX
Digital UNIX
AltaVista Firewall
TCP/IP

Education/Credentials
BSCS

©2016 About.com. All rights reserved.