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
i want a script to execute if the time is 12:00 automatically lakshmananindia UNIX for Advanced & Expert Users 2 09-04-2007 04:22 PM
Can we launch a shell script automatically upon ssh login? rockysfr UNIX for Advanced & Expert Users 1 07-02-2007 10:48 PM
Script to automatically change password. rahulrathod Shell Programming and Scripting 1 10-04-2004 08:33 AM
Script to find PID and kill automatically ST2000 Shell Programming and Scripting 4 08-01-2002 10:38 AM
How to run a script automatically ????? arunava_maity UNIX for Dummies Questions & Answers 7 05-02-2001 10:37 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 Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 10-17-2006
hamsa hamsa is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 7
how to run a Script automatically

How to make a script run automatically using a cron??

i do not know abt cron......

if i have simple.sh file and i need this to run everyday at a particular time what needs to be done


thanks in advance
  #2 (permalink)  
Old 10-17-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
See this link: cron and crontab
  #3 (permalink)  
Old 10-17-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,928
You can edit your own cron table with 'crontab -e'.

For information on the contents of your cron table, see 'man 5 crontab'. If you do not have this manpage, see here.
  #4 (permalink)  
Old 10-17-2006
ankit.jss ankit.jss is offline
Registered User
  
 

Join Date: Oct 2006
Location: India
Posts: 4
u can do it either the crontab way or just add pur ur .sh file in rc.d folder under /
then ur .sh file will be processed every time ur system boots up..
  #5 (permalink)  
Old 10-18-2006
ravikirankethe ravikirankethe is offline
Registered User
  
 

Join Date: Oct 2006
Location: NewYork
Posts: 21
Cron Jobs Usage
=================================================

1. Create a Script that you want to run as a CronJob

2. Assign the Script for the CRONTAB
(CRONTAB would be differ from each user. So if you want to create
a tab for the other user log-on as that user)
crontab -e ==> Command to edit the crontab
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)

3. Crontab Syntax:
crontab [ -u user ] file

<MIN> <HOUR> <DAY_OF_WEEK> <MONTH> <YEAR> <SCRIPT_NAME>

4. Examples

30 9-17 * 1 sun,wed,sat echo `date` >> /date.file 2>&1
At half past the hour, between 9 AM and 5 PM, for every day of January
which is Sunday, Wednesday or Saturday, append date to file date.file

0 23-7/2,8 * * * date
Every two hours from 11p.m. to 7a.m., and at 8a.m.

0 4 1 jan * date
4:00 a.m. on january 1st

To take the physical database backup every day:
15 23 * * * /home/z755692/scripts/makeDbBackup.sh >> /tmp/DBBACKUP/bkup.log


Reference:
==========
http://www.pantz.org/os/linux/programs/cron.shtml
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 05:27 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