new file: pixi.toml
[GalaxyCodeBases.git] / etc / tiny / rsync-retry.sh
blob4b2cef8bcf93ce89e0151f0527eda06aba96b596
1 #!/bin/bash
3 ### ABOUT
4 ### Runs rsync, retrying on errors up to a maximum number of tries.
5 ### Simply edit the rsync line in the script to whatever parameters you need.
7 # Trap interrupts and exit instead of continuing the loop
8 trap "echo Exited!; exit;" SIGINT SIGTERM
10 MAX_RETRIES=50
11 i=0
13 # Set the initial return value to failure
14 false
16 while [ $? -ne 0 -a $i -lt $MAX_RETRIES ]
18 i=$(($i+1))
19 rsync -avz --progress --partial -e "ssh -i /home/youngian/my_ssh_key" /mnt/storage/duplicity_backups backupuser@backup.dreamhost.com:.
20 done
22 if [ $i -eq $MAX_RETRIES ]
23 then
24 echo "Hit maximum number of retries, giving up."