The crontab Command Network Time Distribution

touch sulog; fi 1 1 0 umask 033;cd usradm;if test −s SYSLOG test wc −c SYSLOG −ge 10240; then mv −f SYSLOG oSYSLOG; touch SYSLOG; killall 1 syslogd; fi 2 1 0 umask 033;cd etc; if test −s wtmp test wc −c wtmp −ge 10240; then mv −f wtmp OLDwtmp; touch wtmp; if test −s xwtmp; then mv −f xwtmp OLDxwtmp; touch xwtmp; fi; fi 12 4 sh usrspoollpetcliblog.rotate If this machine is running NIS and its a slave server, the following commands keep the NIS databases up−to−date. 7 9 if etcchkconfig yp; then find usretcyp −type f −name xfr. −mtime + 1 −exec rm −f {} ; ; fi 8 if test −x usretcypypxfr_1ph; then usretcypypxfr_1ph; fi 9 9,15 if test −x usretcypypxfr_2pd; then usretcypypxfr_2pd; fi 10 9 if test −x usretcypypxfr_1pd; then usretcypypxfr_1pd; fi If this machine is a NIS master, ypmake will rotate the log file and ensure that the databases are pushed out with some regularity. It is best to not build and push the databases at the same time the commands above on slave servers are pulling the databases. 0,17,30,45 if etcchkconfig ypmaster etcchkconfig yp test −x usretcypypmake; then usretcypypmake; fi dodisk does the disk accounting 0 2 4 if etcchkconfig acct; then usrlibacctdodisk usradmacctnitedisklog; fi Reorganize file systems 0 3 0 if test −x usretcfsr; then usretcfsr; fi This is for accounting 0 2 4 usrlibacctdodisk

13.2.3 The crontab Command

The crontab command manages a users crontab file. The command schedules jobs assigned to the individual user, to be executed automatically by cron. There is no need for superuser privileges to manage users crontab files; individual users can manage their own crontab files, including root. The command always refers to the crontab file owned by the user who invoked its execution. The format has two basic forms: crontab filename 1. To create or replace a crontab file by copying the specified file or standard input if the filename is omitted. The crontab file lives in the directory usrspoolcroncrontabs and has the same name as the effective user name. crontab option 2. Where the option could be one of these three: −l Display list the users crontab file. −e Edit the users crontab file, or create an empty file if the crontab file does not exist. Once the edit is complete, the file will be copied into the crontabs directory as the users crontab file. −r Remove the users crontab file from the crontabs directory. The command is extremely useful for activating individual users crontab files without needing to manage the cron daemon itself. However, it must be used carefully — the superuser can manage individual users crontab files only by su−ing into the users account. Be aware of the common mistake of activating a users crontab entries by executing the crontab command as the superuser: crontab username 311 After execution of the command, the system will respond with the following message or a similar message; this message is from the HP−UX system: warning: commands will be executed using usrbinsh This message warns that crontab entries, unless they explicitly refer to other shells, should match Bourne shell sh; otherwise the execution could fail. For small modifications of the crontab files, it is recommended that you use the crontab −e command option as the corresponding user, of course. The command invokes the default editor usually, the vi editor, to modify the users crontab file. Once the file is modified and saved and the editor closed, the cron daemon will be automatically recycled; there is no need for any additional action.

13.2.4 Linux Approach