Language Selection

English French German Italian Portuguese Spanish

Starting, Stopping, and Replacing Users' Cron Jobs

Filed under
HowTos

When performing system maintenance, we often disable certain users' cron jobs temporarily. When the maintenance activities are complete, the original crontab files are restored. To facilitate these tasks, we developed two Bourne shell scripts, stop_cron and start_cron. A related script, replace_cron, was developed to remove a user's current crontab file and replace it with the standard file for that user.

The syntax is similar for each script. The names of users whose crontab files will be affected may be supplied as operands. If no user names are specified on the command line, the list of users is read from standard input. To manipulate another user's crontab file, the scripts must execute with root permissions.

Each script depends on the SortingHat utility, which we discussed in our previous Sys Admin article (April, 2007). SortingHat provides the ability to back up the current version of a file and restore the backup copy -- exactly the type of thing we need to do with users' crontab files. If you don't want to install SortingHat, it should be easy to develop alternative implementations for stop_cron and start_cron. However, changing replace_cron might be more complicated, since the program relies on SortingHat to locate a standard crontab file.

Full Story.

More in Tux Machines

Today in Techrights

Linux Kernel and Linux Event

Red Hat News

Leftovers: Software and HowTos

  • Top Software
    The number of open source applications and tools that are available on today’s popular operating systems is simply mind-blowing. They come in all forms. Small scripts and console tools that can be easily integrated into large projects, feature-rich applications that offer everything a complete solution, well designed tools, games that encourage real participation, and eye catching candy. Open source software holds many compelling advantages over proprietary software. Open source improves the quality of the code, keeps costs down, encourages innovation and collaboration, combined with superior security, freedom, flexibility, interoperability, business agility, and much more.
  • Kodi 17.0 "Krypton" Release Candidate 3 Updates Estuary Skin, Fixes More Bugs
    The wait is almost over, and you'll finally be able to enjoy a much modern, improved, and full of new technologies Kodi media center on your PC or HTPC device, be it an Apple TV or Raspberry Pi. Martijn Kaijser announced the third Release Candidate (RC) development version for the Kodi 17.0 "Krypton" media center, and it looks to us like these pre-releases are getting smaller by the day, the RC3 build including only seven changes listed on the release notes attached to the official announcement.
  • Accessing Bingo Sites through Linux
  • Fedora - linux and shell.
  • Getting started with shell scripting