0

We are using cron to trigger web services. When we have a planned outage and the source of the data is going to be unavailable (not the services platform) we determine it was easier to stop crond instead of commenting out 100+ scheduled jobs. Is there an issue with stopping crond for an hour or more? Does this pose a risk to the local system? Our other option is to write a shell script to export the crontab and replace it with a edited file and then swap it back after the outage is complete.

Linux 4.1.12-61.1.22.el6uek.x86_64

Thank you

thinkux
  • 1
  • 1
  • 2

1 Answers1

2

As long as you don't have some busy log rotated hourly that depends on cron (logrotate which depends on cron can be reconfigured to run hourly for example), I don't see the problem.

There are probably many other methods to temporarily prevent the jobs to run. For example: Adding [ ! -e /etc/planned_outage ] && on each cron entry before the command to run. Then doing a touch /etc/planned_outage would prevent the command that follows in the cron line to run. Removing the file would enable it again.

A.B
  • 11,090
  • 2
  • 24
  • 45