LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-03-2010, 07:32 AM   #16
edino
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Red face


I did what you suggested to me. the samething happened, my script was not run.

eg. when it was 2pm. i edited crontab file to run at 5 pm and it worked (it run the script).
after that, i edited the crontab file to run the script at 8am (next day) every min. (* 8 * * * ...) y checked it out at 8:05am (next day) and the script was NOT excuted.
the cron log file has this format from 8:00am to 8:05am
-----------
Nov 3 08:04:01 joseph CRON[19876]: (root) CMD (/home/peter/bin/touch_file)
Nov 3 08:05:01 joseph CRON[19927]: (root) CMD (/home/peter/bin/touch_file)
-------------------------
i edited the crontab file at 8:05am and the script started to run every min. the cron log file has this format from 8:06 am ahead
-------------
Nov 3 08:06:31 joseph crontab[20244]: (root) BEGIN EDIT (root)
Nov 3 08:06:43 joseph crontab[20244]: (root) REPLACE (root)
Nov 3 08:06:43 joseph crontab[20244]: (root) END EDIT (root)
Nov 3 08:07:01 joseph cron[32631]: (root) RELOAD (crontabs/root)
Nov 3 08:07:01 joseph CRON[20290]: (root) CMD (/home/peter/bin/touch_file)
Nov 3 08:08:01 joseph CRON[20329]: (root) CMD (/home/peter/bin/touch_file) ....

------------
Looking forward to getting your feedback.
Blessings
 
Old 11-03-2010, 03:31 PM   #17
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Your entry was executed......
Quote:
Nov 3 08:04:01 joseph CRON[19876]: (root) CMD (/home/peter/bin/touch_file)
Nov 3 08:05:01 joseph CRON[19927]: (root) CMD (/home/peter/bin/touch_file)
The above tells you that the file was executed at 08:04:01 and 08:05:01. It might not have given the expected or required result, but it did run.

This tells me that cron works as expected and that something else is not right/misunderstood.

What happens if you change your touch_file to:
Code:
#!/bin/bash

touch /home/peter/bin/test.txt
 
  


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
Shell Script not Running from Crontab venkatramanj SUSE / openSUSE 3 01-13-2010 05:15 AM
Runs Multiple shell script inside a main script using crontab srimal Linux - Newbie 4 10-22-2009 06:19 PM
Shell script not working through crontab paragkalra *BSD 1 04-15-2009 12:36 PM
how to run crontab in shell script panselva Linux - General 3 05-08-2008 08:33 PM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 02:44 PM


All times are GMT -5. The time now is 03:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration