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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to detect and fix why crontab job is not executed?
# 22  
Old 03-07-2019
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 03-07-2019
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 03-08-2019
The mtime of the directory might be an indicator of when the file was moved.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Detect changes to crontab

Dear All, My server is running crontabs of 4 different users. I want to develop a script that whenever a particular change occurs in a crontab , it is detected and the particular change is noted into a file. Kindly let me know of suggestions on how it can be achieved. My algo would be: ... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

2. UNIX for Dummies Questions & Answers

Cron job executed at wrong time

Dear *nix users. I'm on Mac OS 10.6 / Terminal and try to use crontab to schedule two scripts every 30 minutes and every 41 minutes. I followed the man instructions and created / installed a crontab file for the current user:crontab -e with the following content */30 * * * *... (4 Replies)
Discussion started by: moxnos
4 Replies

3. Shell Programming and Scripting

crontab job not executed with variables

Hi, I am trying to execute a script (for once) during the booting time in Ubuntu system. However, the result is only showing the strings without without the variables. Here is the script: MgrIp=$(ec2-describe-instances --filter tag:Name=Mgr --filter instance-state-name=running | egrep... (4 Replies)
Discussion started by: turki_00
4 Replies

4. Shell Programming and Scripting

Users who desire to have their .profile executed must explicitly do so in the crontab entry. Why?

The .profile file should be read when the user logs in. So, there should be no need to execute .profile file again in a cron job (since the cron job is run after the user logs in). Doesn't the cron require login from the user. Then, from where does the cron execute? Please help!! (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. UNIX and Linux Applications

Log files to view job executed in Autosys -- Help ASAP

Hi all, I really need your help ASAP on this. Below is the description of my problem and a sketch of Autosys Job Activity Console ++++++++++++++++++++++++++++++++ File View Options +++++++++++++++++++++++++++++++ Job Name Description Status Command Machine... (1 Reply)
Discussion started by: sakal_woman
1 Replies

6. Shell Programming and Scripting

Script errors out only when its executed via job

I wrote a script to shutdown the oracle database. The script works fine when I manually run the script. However, when i schedule a job, i get the following error. Shutting Down cmismart .................... ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist SVR4... (6 Replies)
Discussion started by: mrx1350
6 Replies

7. Shell Programming and Scripting

Routine doesn't give output when executed in crontab

I have a script running in the crontab that gets data from a database every hour. Now I would like to execute a fortran routine to process the data in some way, after getting it and saving it locally. I have added the following commands to my script: set convert =... (1 Reply)
Discussion started by: SharkM
1 Replies

8. Shell Programming and Scripting

bash scripting cannot executed in crontab

hi guys, i have a problem. a week ago i made a successful crontab that execute bash scripting daily, it worked well but now, it doesn't work at all, in the mail i have: " /home/jimmy/cha/scripts/cekpderr produced the following output: lagi jalan /home/jimmy/cha/scripts/cekpderr:... (6 Replies)
Discussion started by: jimmbp
6 Replies

9. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

10. Shell Programming and Scripting

ant not being executed as cron job

i have a script that uses an ant build.xml and its targets to pull a project from a cvs server, attempt to build the project, and then email me the results. When I run the script (either @ CLI or as a cron job) while I am logged in, everything works fine. However, if the script is set up to run... (5 Replies)
Discussion started by: kingfinny
5 Replies
Login or Register to Ask a Question