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

If the mtime shown with ls -l was manipulated, ls -lc will show it (it shows the ctime, the last change of the attributes).

1 Like

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?

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

# 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 ---

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.

The mtime of the directory might be an indicator of when the file was moved.

1 Like