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's leftovers

Ninja Blocks prepares to begin shipping, announces major Ubuntu IoT deal

Ninja Blocks has begun shipping the Ninja Sphere and announced it has signed up as a key partner for Canonical’s Ubuntu Core embedded device operating system, as it opens its first office in the US. The startup launched in 2012, when it was selected to participate the Startmate accelerator program, and also smashed a Kickstarter campaign for its first product, which was also called Ninja Blocks. Read more

Netrunner 14.1 – Main Edition (Frontier)

The “14.1” indicates an updated and polished release of Netrunner 14 LTS on the same underlying base. Since 14.1 is using the same base “trusty” like Netrunner 14, there is no need for users of 14 to migrate: Simply updating from the shared backports ppa of the Frontier release cycle should give the same result, while keeping customizations in place. Read more

Wayland 1.6.1 & Weston 1.6.1 Released

Bryce Harrington, the former Canonical employee part of Ubuntu's X/Mir team turned Samsung open-source employee, has issued the first maintenance update for Wayland 1.6. Wayland 1.6.1 and the reference compositor Weston 1.6.1 were released on Friday night by Harrington. The Wayland 1.6.1 stable update has just over a dozen changes and they're mostly tiny bug-fixes/corrections but there is also improved handling for some error situations between servers and clients. The brief Wayland 1.6.1 release announcement can be read on the Wayland mailing list. Read more