Facing issues with cronjobs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Facing issues with cronjobs
# 1  
Old 10-23-2015
Facing issues with cronjobs

Hello Everyone,

We have a cronjob scheduled to pick up files from one system and transfer to another system. the underlying code is a shell script. These cronjobs were working correctly until sometime. 2 days back they did not pick up the scripts but created empty logs. However when we tried running the scripts manually, they worked.

Can somebody suggest pointers towards the root cause?

Thanks!
# 2  
Old 10-23-2015
Without way more info on the system and environment the jobs are running on/in, I think there's little we can do for you.
Did you implement any changes recently?
# 3  
Old 10-23-2015
Given the information so far, ....................., um?? Where do we start?

Because the logs are being written, we can be sure that the cron part works, but is the log created by redirecting the output to a file in the crontab entry, e.g.:-
Code:
00 12 * * * /home/my_noon_script > /home/my_noon_log 2>/hom/myu_noon_errors

After than, can we see the code being called? If not, then we can't really advise you.


Robin
# 4  
Old 10-23-2015
Did the shell script change between the time when it was working as a cronjob and when it started failing as a cronjob? (If so, what changed?)

Did something change on the system running the cronjob between the time when it was working and when it started failing as a cronjob? (New OS release installed? Networking failures reported on system console? ...)

Did smelting change on the system from which you are retrieving files between the time when the shell script was working and when it started failing as a cronjob? (New OS installed? Networking failures reported on system console? Change in the route used to connect the local and remote systems? Change in the permissions or ownership of the files being retrieved? ...)
# 5  
Old 10-23-2015
To explain in more detail:

we have a schedule as below:
Code:
0 * * * * /file path/FileTransfers_IE.ksh

This job runs every 1 hour and executes the above script. The above script in turn calls a series of scripts
Code:
transferFiles.ksh file1.config
transferFiles.ksh file2.config

transferFiles.ksh is the shell script which picks up files from source system using SFTP command, archives the file in local system and then sends the file to a target system.

Past few days the files are not sent to the target system and stuck in the middleware system. Upon investigating further found that the cronjobs are creating empty logs. Upon trying to run manually as below, the files are moved from source to target perfectly.

Code:
transferFiles.ksh file1.config

Today again the jobs worked and files were moved to target system.

Last edited by Don Cragun; 10-23-2015 at 07:15 AM.. Reason: Add CODE tags.
# 6  
Old 10-23-2015
Quote:
Today again the jobs worked and files were moved to target system.
So are you telling us that some days the cron jobs work perfectly and on other days they don't????? That is, this issue is intermittent?
This User Gave Thanks to hicksd8 For This Post:
# 7  
Old 10-23-2015
Please forgive me for being a little blunt, but you haven't shown us the code. It's a bit like ringing the garage to say "My car isn't working" and expecting diagnosis with just the hint that you turn the key. We don't know if the engine turns, if there is fuel or actually that the problem is a flat tyre.

Can you share your code and input files (sanitising any credentials) so we at least have something to consider.

When you run the code manually, is it as the same user account with the same environment set up? Be careful that the environment that a cron job runs with is usually very different to a login user unless you force it to match.



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Facing issues with shell script changes

My current requirement is to replace xxyxx string with value of date date1 variable holds a date and the current script writes html tags to a file as follows echo date1 nawk 'BEGIN{ FS="," print "<HTML>""<HEAD>""<p>Hi All,<br><br>There are no cases closed on the xxyxx" print ... (2 Replies)
Discussion started by: Rajesh A S
2 Replies

2. Shell Programming and Scripting

Facing issues with rsync

Hello Gurus, I am running rsync command to copy certain Directories and files into that directories to remote server. While ruuning the command all teh files has been copied but I am facing error. The below command I am executing to copy Directories and files to remote server: rsync -avrz ssh... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

3. Post Here to Contact Site Administrators and Moderators

Regarding facing issues while accessing UNIX.com site

Hello Moderators/Admins, This is regarding an issue which I am facing from last 7 to 8 days. Issue is while trying to access this forum(simple hitting http://unix.com) I am able to login but many times my request gets timed out or 404 error or if I am able to login it will be excessive slow even... (0 Replies)
Discussion started by: RavinderSingh13
0 Replies

4. Web Development

CronJobs issues after SSL certificate

Hello! I had a cron job running on my website, activating a php script every friday. The Php script just activated another photo to add in the gallery. It worked fine until I got an SSL certificate for my website, then everything broke. This was the command before: lynx -source... (0 Replies)
Discussion started by: AGDesign
0 Replies

5. Shell Programming and Scripting

Facing issues with Content-Type:application/x-download Content-Disposition:attachment

I am in the process of developing a perl cgi page. I had succeeded in developing the page but there are few errors/issues with the page. description about cgi page: My CGI page retrieves all the file names from an directory and displays the files in drop down menu for downloading the... (5 Replies)
Discussion started by: scriptscript
5 Replies

6. UNIX for Dummies Questions & Answers

Facing issues while running a cronjob !

Hi, I am trying to run a cronjob. But while doing so I am getting the following error message :- can't open yourfile in /var/spool/cron/crontabs directory. No such file or directory How can I resolve this issue ? Please help. Thanks Please view this code tag video for... (14 Replies)
Discussion started by: acidburn_007
14 Replies

7. Shell Programming and Scripting

Facing issues with tar and gzip !

Hi, I am trying to :- (1.) Tar the file and then (2.) Gzip it ! Tar command :- tar -cvf BLUESTAR_Archive.log_$(date +%y_%m_%d_%H_%M).tar /app/local/XXX/XXX/XXX/logs Gzip command :- Gzip /app/local/XXX/XXX/XXX/logs/BLUESTAR_Archive.log_$(date +%y_%m_%d_%H_%M).tar ... (9 Replies)
Discussion started by: acidburn_007
9 Replies

8. UNIX for Dummies Questions & Answers

Is this possible with cronjobs?

Hi there, i've a question about cronjobs. I'm creating a concept for a centralized logging repository using log4j/log4net. Sadly the appenders I want to use (fileappenders) aren't telegram based but need a permanent stream to the repository. Because I can not assure this I want to log these... (6 Replies)
Discussion started by: collatz
6 Replies

9. AIX

Cronjobs

We recently upgrade from AIX 4.3.3 to AIX 5.3, We noticed that some cronjobs that run for our programmers did not fire off this morning. You can crontab -l and -e and see the jobs. Did AIX 5.3 change something? Thanks Mike (1 Reply)
Discussion started by: mcastill66
1 Replies

10. UNIX for Dummies Questions & Answers

cronjobs

hi How can I add a cronjob to the crontab file? to execute a shel script named testScript.sh every day at 00:00. Thanks (3 Replies)
Discussion started by: tamer
3 Replies
Login or Register to Ask a Question