LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-21-2007, 07:29 AM   #1
krevathi1912
LQ Newbie
 
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
How to run a shell script evey day automatically at a particular time


I have written a shell script(.sh file) which will automatically start the server of my application.
I want to run this script every day automatically at a certain time without the manual intervention.
How can i do it???????????

Can any one help please


Regards
Revathi
 
Old 09-21-2007, 07:34 AM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
You would use cron for that. Your distribution likely already has a directory called /etc/cron.daily, where you can place scripts that will run every day.

To edit the time the scripts are executed, run "crontab -e" as root to adjust the crontab file.
 
Old 09-22-2007, 11:53 AM   #3
jdiggitydogg
Member
 
Registered: Sep 2007
Posts: 42

Rep: Reputation: 15
you can also run cron jobs as any user. if you want your job to run with root permissions, then edit root's crontab. otherwise, login as whatever user (that has the necessary permissions for your job) and edit their crontab.

/etc holds the system cron files; slightly differnt than user's crontabs.

crontab -l will list the crontab for the current user.
see man crontab for other variations
 
Old 09-22-2007, 01:15 PM   #4
Nimoy
Member
 
Registered: Jun 2003
Location: Currently Denmark
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 30
man is your best friend :o)

man cron <Enter>

Very useful information can be gathered by running man against any command you wish to explore.

You will find a nice tutorial on scripts here:

http://www.linuxcommand.org/index.php

And very relevant cron information here:

http://blog.spikesource.com/crontab.htm
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run shell script as root automatically elempoimen Linux - Software 8 06-20-2010 01:24 AM
Can't seem to run a simple shell script error command not found each time SimonT Linux - Newbie 5 10-29-2006 06:31 AM
shell script to make a program run for a certain time Valkyrie_of_valhalla Programming 4 08-01-2006 06:09 PM
RH8 - how to automatically run a shell script at boot time nu-B Linux - Newbie 2 11-03-2003 02:47 PM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 08:38 PM


All times are GMT -5. The time now is 06:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration