LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   can't add a default route from cron (https://www.linuxquestions.org/questions/linux-networking-3/cant-add-a-default-route-from-cron-604905/)

ddaas 12-06-2007 06:33 AM

can't add a default route from cron
 
Hi there,
I want to add a default route from cron and it doesn't work. I can't image why. Maybe there are some cron variables or something...??!!

1. crontab -e (as root)
* * * * * route add default gw X.12.12.1


or

* * * * * /root/s1

and s1 contains the command from above.

When I run the script manually it works, but not from cron.

Any help would be appreciated.

Thanks

bathory 12-06-2007 07:11 AM

Use the full path for the route command in crontab, or in the script:
Code:

* * * * * /sbin/route add default gw X.12.12.1

ddaas 12-06-2007 07:41 AM

Thanks,
It worked!


All times are GMT -5. The time now is 09:23 PM.