The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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-06-2008 02:46 AM
How to Control Cronjobs using Shell Script?? hanu_oracle Shell Programming and Scripting 8 03-18-2008 11:49 AM
Delete Duplicate Cronjobs nskworld UNIX for Advanced & Expert Users 2 07-20-2007 10:30 AM
Time Zone in AIX and cronjobs run_time_error AIX 1 04-28-2006 06:42 AM
Cronjobs mcastill66 AIX 1 05-31-2005 02:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2001
tamer tamer is offline
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]
  #2 (permalink)  
Old 01-22-2001
Mardio Mardio is offline
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 (permalink)  
Old 01-22-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
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 (permalink)  
Old 01-22-2001
98_1LE 98_1LE is offline Forum Advisor  
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)
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0