Summary

We started this chapter by showing the new at command and explaining how we can use at for scheduling scripts. We described the timestamp syntax for at and how it contains a queue for all scheduled jobs. We explained how at is mostly used for ad hoc scheduled commands and scripts, before we continued to the more powerful cron scheduler.

The cron daemon, responsible for most scheduled tasks on a system, is a very powerful and flexible scheduler, which is most often used via the so-called crontab. This is a user-bound file, which contains instructions for cron on when and how to run commands and scripts. We presented the timestamp syntax that is used in a crontab.

The second part of the chapter dealt with logging our scheduled commands and scripts. When a command is run interactively on the command line, there is no need for dedicated logging, but scheduled commands are not interactive, and thus need additional mechanisms. Output from scheduled commands can either be mailed to a local file with the sendmail process, or redirected to a log file using the redirection possibilities we outlined earlier.

We ended the chapter with some final considerations on logging: how it should always be the responsibility of the caller to arrange logging, and how it is the responsibility of the script author to make sure a script is verbose enough to be used non-interactively.

The following commands were introduced in this chapter: at, wall, atq, atrm, sendmail, crontab, and alias.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.17.154