Results 11 to 18 of 18
I tried adding the error checking and ran the cron job again and it didn't give an error message. I still think the problem lies in the rsh command although ...
- 08-09-2005 #11Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
I tried adding the error checking and ran the cron job again and it didn't give an error message. I still think the problem lies in the rsh command although I did notice something weird when the cron job ran....you would expect $ERRORLOG to be created almost immediately after the cron job starts, but it took a good minute for the $ERRORLOG to appear.
- 08-09-2005 #12
Ok, how about this - for the script you're running remotely, is there an easy way to tell if it has begun? If not, add to the beginning of the script something like:
You can at least begin to isolate the problem this way. If script-log never appears, you know it is hanging at some point in the actual rsh command. If script-log appears, then you can add further echo statements to see where in the remote script is hanging.Code:echo 'Remote script started...' > script-log
- 08-09-2005 #13Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
I'm going to uninstall/reinstall rsh and see if it helps any. Maybe there was a problem when I installed it the first time.
- 08-10-2005 #14Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
Well, reinstalling rsh didn't help any. This is driving me nuts!!! I need this thing to work so I don't have to run updates manually ever 2 hours.
- 08-11-2005 #15Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
I don't think I mentioned this before, but for some reason there are always two instances of rsh spawned when you run the rsh command. It doesn't matter how you launch it, it always spawns to processes. Is this normal?
- 08-11-2005 #16Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
Here is something else kind of stupid....if I remove the rcp line right after the rsh line that is giving me trouble, the script will run via cron. WTF!
- 08-12-2005 #17Just Joined!
- Join Date
- Jun 2005
- Posts
- 47
Arg!! I should have read the man pages! I just read through them and realized that the whole problem with the script is that rsh wants to spit out something to the console, but it can't when it is launched by cron. The trick is to use the -n option to direct the output to /dev/null. When this is done, the script works without a problem.
- 08-13-2005 #18Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Well done on figuring it out. You've also reminded me that I used to do that when I wrote a bunch of rsh-ing scripts for a project, and I'd completely forgotten that I'd used the -n trick, too! D'oh!
Originally Posted by HaMBoNE79


Reply With Quote