Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Cron job scheduled is running once, but reports are generating twice


Login or Register to Reply

 
Thread Tools Search this Thread
# 9  
So as neo suggested, why don't you insert a timestamp generation logging command into the script that will write a file every time the job runs.

What's the last modified time on the duplicate output reports that you have? Are they created/modified at exactly the same time?
# 10  
Maybe something like this, just an example, in the script:

Code:
echo $(date +%s)  >> /tmp/mylogfile.txt


Code:
# echo $(date +%s)  >> /tmp/mylogfile.txt
# cat /tmp/mylogfile.txt
1561379037
# echo $(date +%s)  >> /tmp/mylogfile.txt
# cat /tmp/mylogfile.txt
1561379037
1561379165
# echo $(date +%s)  >> /tmp/mylogfile.txt
# cat /tmp/mylogfile.txt
1561379037
1561379165
1561379175

Or even something better Smilie
This User Gave Thanks to Neo For This Post:
# 11  
Thanks Neo/Hick.. giving it a try.. so logging is a remedy Smilie

--- Post updated at 12:55 AM ---

@hick ..the duplicate record is in (45 seconds),from the first one
# 12  
You need to be more specific in your analysis and posts.

For example:

Please post the last 10 entries of the DB timestamps vis-a-vis the timestamps from the script.

For example, you informed us that there is a duplicate DB entry 45 seconds from the first entry; but you did not yet inform us when the crontab runs, nor did you provide the crontab entry and nor did you provide the crontab script.

You seem to be asking for us to make up a solution or possible cause to your problem but you are not willing to provide any details.

Why not just provide the details so we can help you?
# 13  
Hi Neo,

I did cross checked it the log has that mechanism covered in it,logs are getting generated as per timestamp when its run.. and a file is created with the date time stamp for the cron scheduled.

eg logifile25062019.txt (DDMMYY)

But still on the DB side we are observing duplicate entries for that job scheduled
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
Scheduled job not running automatically in crontab
Santhosh CJ
i have a job scheduled in crontab. The problem is, it is not running automatically as per the time scheduled. But runs when executed manually. What would be the problem? Help me with this please.... Shell Programming and Scripting
6
Shell Programming and Scripting
Cron Jobs not running at scheduled time
vamshigvk475
I've scheduled few jobs using cron. But they are not running ..... What might be the possible reasons ?? Also tell me how to troubleshoot............. Please help me ....... Thanks in Advance.... Red Hat
2
Red Hat
Oracle Scheduled job not running as per schedule.
suresh_kb211
Hi, Though this is a unix forum mainly, am posting this oracle query here hoping to get a resolution. I have set up two scheduled jobs in oracle 11g for executiong a procedure in specific time intervals. One as Hourly and other as minutely. But the scheduled jobs are not running as per...... Programming
2
Programming
problem when the script is scheduled to run as cron job
forumthreads
Hello, I have problem in executing a shell script. When the shell script is executed at the shell prompt the script works successfully but when the same script is run as a cron job it fails to execute the files called within the shell script. I have scheduled the job in my crontab file as ...... UNIX for Dummies Questions & Answers
6
UNIX for Dummies Questions & Answers
Conditional File Movement script scheduled using CRON job
imu
Hi All, i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate. 1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a...... Shell Programming and Scripting
2
Shell Programming and Scripting

Featured Tech Videos