I have debian squeeze installed on my box. I have BIRD daemon to route traffic of particular IP. We add IP to bird-route.conf automatically from ruby script if traffic spikes up to specific range. I would like to know the possible ways to send notification of added IP to remove from bird-route.conf after certain period, for example say If script adds the IP in bird-route.conf file at 12.00AM so notification script should notify me after 48 hours to remove it. How can I achieve this ? shell, perl or ruby any of the scripting would work. 
1 Answer
One mechanism for "delayed action" in Unix is at. Some system administrators may disable its usage, but if it's available, it can help you solve your problem.
- Your "add" script can add the IP, then fire off an - atjob that calls a "remove" script with the same IP as a parameter.
- Once the - atjob runs, it should check the target configuration to see if the given IP is still there (I'm not sure if your situation allows for the same IP to be "added" twice).


atjob to call a removal script of the same IPatisn't installed, just run the removal or notification script after asleep 2d(orsleep 172800if your version of sleep doesn't understand thedsuffix for days).