|
|||
1. Managing Terminals and Modems (Overview) 2. Setting Up Terminals and Modems (Tasks) 3. Managing Serial Ports With the Service Access Facility (Tasks) 4. Managing System Resources (Overview) 5. Displaying and Changing System Information (Tasks) 8. Scheduling System Tasks (Tasks) Creating and Editing crontab Files (Task Map) Ways to Automatically Execute System Tasks Scheduling a Repetitive System Task (cron) Controlling Access to the crontab Command How to Deny crontab Command Access How to Limit crontab Command Access to Specified Users Using the at Command (Task Map) Scheduling a Single System Task (at) How to Deny Access to the at Command How to Verify That at Command Access Is Denied 9. Managing System Accounting (Tasks) 10. System Accounting (Reference) 11. Managing System Performance (Overview) 12. Managing System Processes (Tasks) 13. Monitoring System Performance (Tasks) 14. Troubleshooting Software Problems (Overview) 16. Managing Core Files (Tasks) 17. Managing System Crash Information (Tasks) 18. Troubleshooting Miscellaneous Software Problems (Tasks) 19. Troubleshooting File Access Problems (Tasks) 20. Resolving UFS File System Inconsistencies (Tasks) |
Creating and Editing crontab FilesThe simplest way to create a crontab file is to use the crontab -e command. This command invokes the text editor that has been set for your system environment. The default editor for your system environment is defined in the EDITOR environment variable. If this variable has not been set, the crontab command uses the default editor, ed. Preferably, you should choose an editor that you know well. The following example shows how to determine if an editor has been defined, and how to set up vi as the default. $ which $EDITOR $ $ EDITOR=vi $ export EDITOR When you create a crontab file, it is automatically placed in the /var/spool/cron/crontabs directory and is given your user name. You can create or edit a crontab file for another user, or root, if you have superuser privileges. How to Create or Edit a crontab FileBefore You BeginIf you are creating or editing a crontab file that belongs to root or another user you must become superuser or assume an equivalent role. Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services You do not need to become superuser to edit your own crontabfile.
The following example shows how to create a crontab file for another user. # crontab -e jones The following command entry added to a new crontab file automatically removes any log files from the user's home directory at 1:00 a.m. every Sunday morning. Because the command entry does not redirect output, redirect characters are added to the command line after *.log. Doing so ensures that the command executes properly. # This command helps clean up user accounts. 1 0 * * 0 rm /home/jones/*.log > /dev/null 2>&1 How to Verify That a crontab File Exists
|
||
|