1

Am trying to do some routing on a remote Linux server, every time something goes wrong i lose connection and i have to call the IT guy there and ask him to restart the network interfaces or sometimes reboot the server to get rid of the bad routes i inserted.

I tried to make cron restart networking every 7 minutes to reset the route table by running /etc/init.d/networking restart but its not restarting. i tried making cron run a bash file that has that command in it and still the same.

Is there anyway to reset the route table via cron ?

1 Answer 1

3

You need to make sure you are running the cron job as root. Otherwise, you will get permission denied error and cron job will not run.

IMHO, this is not a good solution to your problem. This is really unacceptable especially if you are doing it on a production server. Restarting the network on a server will drop all connections and can cause data loss. You need to find the root-cause of this issue and try to fix it.

3
  • I am adding the command using crontab -e, isn't that the root's cron ?
    – zertux
    Feb 17, 2013 at 11:00
  • It depends on the user executing command. For root, you need to login as root or use sudo crontab -e.
    – Khaled
    Feb 17, 2013 at 11:29
  • Yes, i am adding it as root user, any other way ?
    – zertux
    Feb 17, 2013 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .