![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting cronjobs... | krworks | Shell Programming and Scripting | 4 | 06-05-2008 11:46 PM |
| How to Control Cronjobs using Shell Script?? | hanu_oracle | Shell Programming and Scripting | 8 | 03-18-2008 08:49 AM |
| Delete Duplicate Cronjobs | nskworld | UNIX for Advanced & Expert Users | 2 | 07-20-2007 07:30 AM |
| Time Zone in AIX and cronjobs | run_time_error | AIX | 1 | 04-28-2006 03:42 AM |
| Cronjobs | mcastill66 | AIX | 1 | 05-31-2005 11:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi
How can I add a cronjob to the crontab file? to execute a shel script named testScript.sh every day at 00:00. Thanks [Edited by tamer on 01-22-2001 at 09:37 AM] |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Add the following line to the /var/spool/cron/crontabs/owner of testScript.sh file using the vi editor:
0 0 * * * /absolute Path/testScript.sh The format of this file is six fields: minute (0-59); hour (0-23); day of month (1-31); month (1-12); weekday (0-6,0=Sunday); command to execute. I am not certain of the command syntax. The crontab search path for can be set in /etc/default/cron file PATH= for user's, SUPATH= for root cronjobs. Access to the crontab command (used to execute/delete/list cronjobs) is controlled by /etc/cron.d/cron.allow or the /etc/cron.d/cron.deny files (one user per line). Basically a user will be able to use the crontab command if the account is listed in the cron.allow file. By default all initial non-admin accounts are listed in the cron.deny file. If the cron.allow file does not exist users will be allowed access to the crontab command as long as they are not listed in the cron.deny file. Mardio |
|
#3
|
||||
|
||||
|
Quote:
Quote:
|
|
#4
|
|||
|
|||
|
The only thing I would like to add is that it is sometimes necesary to set the $EDITOR variable before executing `crontab -e`
To do this, type EDITOR=vi;export EDITOR Otherwise it will open your crontab file with ed (unfriendly line editor) |
|||
| Google The UNIX and Linux Forums |