Results 1 to 2 of 2
Hello!
I am new to your forum.
I have a problem that I cannot debug or resolve on a Fedora Core 8 machine. The problem exists in a Fedora 11 ...
- 09-25-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 2
[SOLVED] Cron job, rights to execute a script
Hello!
I am new to your forum.
I have a problem that I cannot debug or resolve on a Fedora Core 8 machine. The problem exists in a Fedora 11 machine as well.
I have a script that changes the default gw (I have 2 providers) if the link is down. The script runs very well when I call it from the terminal, however when I try to set a cron job to run it, it hangs in the middle of the script.
I don't have any idea of what is happening, or how to debug but it seems to hang when running a command like:
route add default gw [ip]
I can publish the script here, but it's fair an simple and the algorithm is:
- start
- Find out the current GW
- Find out the alternative GW
- Ping the current GW and capture the result
- if we have a fail then change the default gw to the alternative Gw and send an email, else do nothing
- end
The cron job is runned as root, so I don't think this is a rights problem.
Can anybody give me an ideea of how to debug or to resolve this issue?
Thank you,
- 09-30-2009 #2Just Joined!
- Join Date
- Sep 2009
- Posts
- 2
I've solved the problem. It was from environment variables that cron uses.
Problem solved!


