From the computer of: qmchenry
(339 recipes)
Created: Oct 11, 2003 Updated: Oct 12, 2003
To edit the crontab file, the crontab program must be used. The actual crontab files should not be edited directly because the contents are cached and changes will not take effect until the crond process is restarted. Using the crontab program to edit the crontabs will update the cache when the file is changed. To edit the current user's crontab file, use:
The -e option tells the program to edit a copy of the user's crontab file. The EDITOR environment variable is referenced to determine which editor to use (default is ed). To set this environment variable, see recipes for ksh and sh.
The superuser can edit a specific user's crontab by adding the username at the end of this command. The processes run from a user's crontab will be run as that user. Be careful with commands in root's crontab because these will run as root and could cause problems. If shell scripts are run from root's crontab, make sure their file permissions do not allow modification by anyone but root.
The syntax of crontab is simple. Each line represents a single scheduled task. The first five fields represent timing information and everything following is interpreted as the command to schedule. The timing fields in order are:
minutes - 0-59
hours - 0-23
days of month - 1-31
months of year - 1-12
days of week - 0-6 (Sunday-Saturday)
A variety of options work for each field. An asterisk (*) indicates all possible occurrences for that field. A number sets that single occurrence. Two numbers separated by a - indicates a range of values, and numbers separated by a comma indicate a list of occurrences.
Several examples:
15 * * * * logcheck
Runs a command called 'logcheck' every 15 minutes of every day.
0,15,30,45 8-17 * * 1-5 dobackup
Runs dobackup every 15 minutes (i.e., 8:00, 8:15, 8:30, and 8:45) during business hours (from 8:00 to 17:00) during business days (Monday-Friday).
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
3 Recipe comments: View comments
Automate processes with cron and crontab in Solaris by Anonymous
Re: Automate processes with cron and crontab in Solaris by Anonymous
Re: Automate processes with cron and crontab in Solaris by Anonymous
Related recipes:
Solaris: fuser to find users or processes making filesystem umount fail
Power off a Solaris system
Understanding Solaris runtime control scripts
Solaris: unmounting a filesystem with umount
Monitor Solaris system load: understanding vmstat
Change BootPROM settings from the Solaris command line
Change Solaris DNS client settings
Reboot a Solaris system
Prevent Solaris core files creation with coreadm
Solaris 10: shutdown or stop a zone
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
Make XP look like Windows Vista / Longhorn for free!
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
SMS through E-Mail: Cingular, Nextel, Sprint, T-Mobile, Verizon, Virgin Mobile
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
How Do I Use or Open Bin, Cue, or ISO Files?
MySpace Hack: View Pictures and Comments on a Private Profile
Hacks to Beat Rapidshare Download Limits and Waiting Time
MySpacé: Hack to Download Any Song on Mysapcé
Who's Online
There are currently, 1927 guest(s) and 2 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 0.99 Seconds
Thu Aug 28 21:42:02 2008