LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-21-2010, 07:59 AM   #1
suj
Member
 
Registered: Dec 2009
Posts: 33

Rep: Reputation: 1
running scripts with cron


i have a script in /root/new.sh .how can i run this script with cron??
crontab -e
* * * * * "how to give path to script?"
 
Old 07-21-2010, 08:14 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
Hi suj,

Try following entry

Code:
crontab -e

30 * * * * /bin/bash /root/new.sh
new.sh script execute every 30 min.
 
Old 07-21-2010, 04:56 PM   #3
Filip_Kv
LQ Newbie
 
Registered: Mar 2010
Location: Thessaloniki, Greece
Distribution: Debian, Ubuntu, CentOS, Fedora
Posts: 11

Rep: Reputation: 2
Make sure that the script in /root has executable permissions before scheduling it.
As root type:

Code:
chmod 700 /root/new.sh
crontab -e
30 * * * * /root/new.sh
to execute it every 30 mins.
 
  


Reply

Tags
cron


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
Running shell scripts with cron Lossenelin Linux - General 2 09-24-2009 02:51 PM
Running Scripts at Boot, via Cron etc maxhugen Linux - Newbie 2 12-06-2005 09:42 PM
What are you're best Cron scripts? deception Programming 7 11-11-2005 06:37 PM
cron scripts kirmet Programming 1 10-20-2005 12:37 PM
expect scripts and cron banderson Linux - Software 8 05-27-2005 04:44 AM


All times are GMT -5. The time now is 01:50 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