Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Administration: Common Tasks Oracle Solaris 11 Information Library |
1. Locating Information About Oracle Solaris Commands
2. Managing User Accounts and Groups (Overview)
3. Managing User Accounts and Groups (Tasks)
4. Booting and Shutting Down an Oracle Solaris System
5. Working With Oracle Configuration Manager
6. Managing Services (Overview)
9. Managing System Information (Tasks)
10. Managing System Processes (Tasks)
11. Monitoring System Performance (Tasks)
12. Managing Software Packages (Tasks)
14. Scheduling System Tasks (Tasks)
Creating and Editing crontab Files (Task Map)
Ways to Automatically Execute System Tasks
For Scheduling Repetitive Jobs: crontab
For Scheduling a Single Job: at
Scheduling a Repetitive System Task (cron)
How the cron Daemon Handles Scheduling
Syntax of crontab File Entries
Creating and Editing crontab Files
How to Create or Edit a crontab File
How to Verify That a crontab File Exists
Controlling Access to the crontab Command
How to Deny crontab Command Access
How to Limit crontab Command Access to Specified Users
How to Verify Limited crontab Command Access
Using the at Command (Task Map)
Scheduling a Single System Task (at)
Controlling Access to the at Command
How to Deny Access to the at Command
How to Verify That at Command Access Is Denied
15. Setting Up and Administering Printers by Using CUPS (Tasks)
16. Managing the System Console, Terminal Devices, and Power Services (Tasks)
17. Managing System Crash Information (Tasks)
18. Managing Core Files (Tasks)
19. Troubleshooting System and Software Problems (Tasks)
20. Troubleshooting Miscellaneous System and Software Problems (Tasks)
By default, crontab file protections are set up so that you cannot inadvertently delete a crontab file by using the rm command. Instead, use the crontab -r command to remove crontab files.
By default, the crontab -r command removes your own crontab file.
You do not have to change the directory to /var/spool/cron/crontabs (where crontab files are located) to use this command.
Before You Begin
Become the root user to remove a crontab file that belongs to root or another user. Roles contain authorizations and privileged commands.
You do not need to become root to remove your own crontab file.
# crontab -r [username]
where username specifies the name of the user's account for which you want to remove a crontab file. Removing crontab files for another user requires superuser privileges.
Caution - If you accidentally type the crontab command with no option, press the interrupt character for your editor. This character allows you to quit without saving changes. If you instead saved changes and exited the file, the existing crontab file would be overwritten with an empty file. |
# ls /var/spool/cron/crontabs
Example 14-5 Removing a crontab File
The following example shows how user smith uses the crontab -r command to remove his own crontab file.
$ ls /var/spool/cron/crontabs adm jones root smith sys uucp $ crontab -r $ ls /var/spool/cron/crontabs adm jones root sys uucp