LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 05-01-2009, 08:07 AM   #1
tamilm
Member
 
Registered: Jun 2008
Posts: 43

Rep: Reputation: 15
cron did not work


Hi all

i wrote the shell script which copy the video file into some

location.i want to run this script every one minute automatically.so i use

crontab -e

01 * * * * /root/test.sh -->path to script

which create a rootfile in the /var/spool/cron/ in the directory.then i

restarted the cron daemon.but no file in the path i have given after one

minute.can anyone help me





regards
tamil.M
 
Old 05-01-2009, 08:16 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Start with Logs

I don't recognize -> as a legal redirector.

Also, look in your logs (/var/log) to see what cron thinks is happening.
 
Old 05-01-2009, 10:30 AM   #3
jan61
Member
 
Registered: Jun 2008
Posts: 235

Rep: Reputation: 47
Moin,

Additionally to cmnorton's post: the syntax you wrote starts the script at the first minute of every hour, not every minute. Use "*" instead.

Jan
 
Old 05-01-2009, 10:36 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
post the content of
/root/test.sh

In general you need to give the whole path to all the commands you use.
 
Old 05-01-2009, 10:36 AM   #5
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
cmnorton, I don't think tamilm is using '-->' as a redirector but rather to let us know that /root/test.sh is the path to the script (of course, I could be wrong). My guess it the 01 syntax that is being used for the minute parameter as jan61 suggests.

One more note for tamilm, in the future if you want to change this to run every other minute or every five minutes, etc., you can change the line to:

*/2 * * * * /root/test.sh

or

*/5 * * * * /root/test.sh

HTH

Forrest
 
  


Reply



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
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
help with cron can't get it to work Jiraiya Linux - General 12 03-07-2006 08:39 PM
nmap with cron does not seem to work Gnarg Linux - Software 2 08-04-2004 10:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration