We have created a script that's checks the latency of IIDR subscription by fetching details from a config file (that contains subscription details) and running the CHCCLP command. The out put is then concatenated in a csv file. Once all subscription details are saved the script send a mail alert to the recipients. This script works perfectly when run manually but when we are running it through Crontab the output multiplies with every iteration. So the report should should always give report of 23 subscription but with crontab with every nth iteration the output is 23*n. Could you please help me with some suggestion to resolve this issue.
Can you check under the users home directory for more than one copy of the "LatencyStatus.csv" file, there may be une under /home/cdc_access/scripts and one under /home/cdc_access
These types of issues are generally caused by PATH (shell environmental) and file permission issues.
You did not yet provide any user information for either running the script manually or in a crontab; and nor did you provide the environmental variables for the respective users. It matters (the user and the environmental variables).
When you provide that information, the root cause of any issue should start to be more clear.
But please also address gull's line of questioning as well.
I found a copy of "LatencyStatus.csv" file, under /home/cdc_access. I removed the file and tried running the crontab but this time there is no output records in the mail report.
Got the output error
awk: cmd. line:13: fatal: cannot open file `LatencyStatus.csv' for reading (No such file or directory).
Oh Yes!! Thanks Gull04. The script is now running from crontab correctly.
Thanks Neo for help. Sorry I could not provide more details for your queries as I am kind of amateur to this.