How to detect and fix why crontab job is not executed?


Login or Register to Reply

 
Thread Tools Search this Thread
# 22  
Old 2 Weeks Ago
I wouldn't a priori assume the files' time stamps be messed around with. Is it possible files are created with correct time stamps but in a different directory, and copied later than 6:00h to your source directory?
# 23  
Old 2 Weeks Ago
Quote:
Originally Posted by MadeInGermany
If the mtime shown with ls -l was manipulated, ls -lc will show it (it shows the ctime, the last change of the attributes).
Thanks MadeInGermany.

Thats is the issue. Some process creates the file with date of 1 day ago but is created or modified in all cases the nex day.

This is for the last 5 file

Code:
# ls -lc | tail -5
-rw-r--r--   1 root     root      447624 Mar  3 09:23 LogFile.2019-03-02
-rw-r--r--   1 root     root      163406 Mar  4 07:10 LogFile.2019-03-03
-rw-r--r--   1 root     root      480599 Mar  5 08:57 LogFile.2019-03-04
-rw-r--r--   1 root     root      660980 Mar  6 00:02 LogFile.2019-03-05
-rw-r--r--   1 root     root      376530 Mar  7 07:54 LogFile.2019-03-06

So I think the solution is to change the hour for cron job to run after 10:00 am for example.

Many thanks for all the help to all of you!

--- Post updated at 07:01 PM ---

Quote:
Originally Posted by RudiC
I wouldn't a priori assume the files' time stamps be messed around with. Is it possible files are created with correct time stamps but in a different directory, and copied later than 6:00h to your source directory?
Hi RudiC, what you says is probably what is happenning, but I don't know which would be the other directory where files could be created and the copied to the other directory next day.

For now I think running the cron job later would fix the issue.

Many thanks for you great support.
# 24  
Old 2 Weeks Ago
The mtime of the directory might be an indicator of when the file was moved.
This User Gave Thanks to RudiC For This Post:
Ophiuchus (2 Weeks Ago)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Crontab job is not working ipfreak UNIX for Dummies Questions & Answers 6 03-06-2016 04:39 AM
Detect changes to crontab Junaid Subhani Shell Programming and Scripting 1 08-28-2013 05:15 AM
Crontab Job Syntax JolietJake Shell Programming and Scripting 1 06-28-2013 09:43 PM
Cron job executed at wrong time moxnos UNIX for Dummies Questions & Answers 4 12-07-2012 12:45 PM
crontab job not executed with variables turki_00 Shell Programming and Scripting 4 10-04-2012 09:01 AM
Users who desire to have their .profile executed must explicitly do so in the crontab entry. Why? thulasidharan2k Shell Programming and Scripting 1 07-29-2011 02:36 AM
Schedule a job using Crontab jatanig Shell Programming and Scripting 1 03-15-2010 09:45 AM
Log files to view job executed in Autosys -- Help ASAP sakal_woman UNIX and Linux Applications 1 05-22-2009 07:47 PM
Script errors out only when its executed via job mrx1350 Shell Programming and Scripting 6 03-26-2009 01:50 PM
Routine doesn't give output when executed in crontab SharkM Shell Programming and Scripting 1 02-12-2008 09:56 AM
Help with a crontab job!!! kumarsaravana_s Shell Programming and Scripting 4 03-28-2007 04:02 AM
bash scripting cannot executed in crontab jimmbp Shell Programming and Scripting 6 11-11-2005 10:23 AM
crontab job Moe UNIX for Dummies Questions & Answers 3 11-02-2005 04:17 PM
Shell script doesn't get executed using crontab radhika Shell Programming and Scripting 11 06-09-2005 04:28 PM
ant not being executed as cron job kingfinny Shell Programming and Scripting 5 11-12-2004 12:11 PM