Here are some typical environment variables as set
Here are some typical environment variables as set in /etc/crontab on a FreeBSD 4.5-STABLE system. ……………………………………………………………………………………….. # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=/ # ……………………………………………………………………………………….. The hash marks are comments or empty lines used to separate entries and make the file somewhat easier to read. Beneath the environment information, the crontab file is divided into eight columns, forming a table. The first six columns represent the time the command should run: minute, hour, day of the month, month of the year, and day of the week, in that order. An asterisk (*) in any column means “every one,” while a number means “at this exact time.” Following the time columns is the username the job runs as, then the command. User crontab files are almost identical, lacking only the username column. Specifying Times You must use a valid number for times in crontab. The rule is that minutes, hours, and days of the week start with 0, and days of the month and months begin with 1. Also, thanks to an ancient disagreement between AT&T and BSD, the day of the week uses both 7 and 0 for Sunday. For example, to have user dbadmin run the program /usr/local/bin/db backup.sh at 55 minutes after each hour, every day to infinity, your crontab line would look like this: ……………………………………………………………………………………….. 55 * * * * * dbadmin /usr/local/bin/db-backup.sh ……………………………………………………………………………………….. Asterisks tell cron to run this job every hour, every day of the month, every month, and every weekday. To run this job only at 1:55 PM each day, you would use the following: ……………………………………………………………………………………….. 55 13 * * * * dbadmin /usr/local/bin/db-backup.sh ……………………………………………………………………………………….. Here, 13 represents 1:00 PM on the 24-hour clock, and 55 the number of minutes past the hour. One common mistake people make when using cron is to specify a large unit of time, but miss the small one. For example, suppose you entered the following, intending to run a job every day at 8 189
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Unix Web Hosting services