Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Just 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.

  2. #12
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    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:
    Code:
    echo 'Remote script started...' > script-log
    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.

  3. #13
    Just 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.

  4. $spacer_open
    $spacer_close
  5. #14
    Just 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.

  6. #15
    Just 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?

  7. #16
    Just 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!

  8. #17
    Just 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.

  9. #18
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Quote Originally Posted by HaMBoNE79
    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.
    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!

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •