The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2001
Registered User
 

Join Date: Jan 2001
Posts: 9
Angry

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  
Old 01-22-2001
Registered User
 

Join Date: Jan 2001
Location: Richmond, VA
Posts: 3
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  
Old 01-22-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Quote:
Add the following line to the /var/spool/cron/crontabs/owner of testScript.sh file using the vi editor:
It is better (and easier) to use the 'crontab -e' command to edit your crontab file.


Quote:
By default all initial non-admin accounts are listed in the cron.deny file.
Not necessarily true for all Unix flavors...
  #4  
Old 01-22-2001
Registered User
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0