LCOD 10.9.09 – Script to retry command


I use this almost exclusively with trying to ssh to a machine that’s rebooting, but it’s useful to have, and, I think, should be included as a default command in any Linux distro.

Script : retry
Usage : retry command [args]

Code :

#!/bin/bash
while true
do
echo "trying $@ at `date`"
$@
sleep 1
done

Enjoy.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

, , , ,

Easy AdSense by Unreal