Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Advanced Administration Oracle Solaris 10 8/11 Information Library |
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)
7. Managing UFS Quotas (Tasks)
8. 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
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)
The crontab -l command displays the contents of a crontab file much the same way that the cat command displays the contents of other types of files. You do not have to change the directory to /var/spool/cron/crontabs directory (where crontab files are located) to use this command.
By default, the crontab -l command displays your own crontab file. To display crontab files that belong to other users, you must be superuser.
Before You Begin
Become superuser or assume an equivalent role to display a crontab file that belongs to root or another user.
You do not need to become superuser or assume an equivalent role to display your own crontab file.
$ crontab -l [username]
where username specifies the name of the user's account for which you want to display a crontab file. Displaying another user's crontab file 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. |
Example 8-2 Displaying a crontab File
This example shows how to use the crontab -l command to display the contents of the user's default crontab file.
$ crontab -l 13 13 * * * chmod g+w /home1/documents/*.book > /dev/null 2>&1
Example 8-3 Displaying the Default root crontab file.
This example shows how to display the default root crontab file.
$ suPassword: Oracle Corporation SunOS 5.10 Generic Patch January 2005 # crontab -l #ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */ # # The root crontab should be used to perform accounting data collection. # # 10 3 * * * /usr/sbin/logadm 15 3 * * 0 /usr/lib/fs/nfs/nfsfind 30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean #10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
Example 8-4 Displaying the crontab File of Another User
This example shows how to display the crontab file that belongs to another user.
$ su Password: Oracle Corporation SunOS 5.10 Generic Patch January 2005 # crontab -l jones 13 13 * * * cp /home/jones/work_files /usr/backup/. > /dev/null 2>&1