Don’t be a Tw@t – Use At!

Sigh :( today I made a schoolboy error – making config changes to a live firewall on a remote server without giving myself any kind of safety net! Anyway, this is an example of where you should really use something like the at command to bail you out should anything go wrong:

get the current system time:
date

Schedule at to run a command 5 minutes from now:
at -m 13:50
service iptables stop
ctrl-d


Now, make those firewall changes that you need to, without worrying!

If all goes belly up, at will stop the firewall in 5 mins.

If all goes well, you can cancel the at command:
atq
atrm 2

/numptyness

You can leave a response, or trackback from your own site.

Leave a Reply