diff --git a/backup/pull-backups.sh b/backup/pull-backups.sh new file mode 100644 index 0000000..68ac021 --- /dev/null +++ b/backup/pull-backups.sh @@ -0,0 +1,17 @@ +#!/bin/bash +DATE=$(date +"%d-%m-%Y") +PULL_DIR='backups' +SSH_KEY='/home/bakerupper/.ssh/bakerupper_key' + +SERVERS=( + 'bakeruper;mail.pikami.org;/home/bakeruper/backups/*' + 'bakeruper;baguette.pikami.org;/home/bakeruper/backups/*' +) + +# Pull backups +for i in "${SERVERS[@]}" +do + conf=(${i//;/ }) + mkdir -p $PULL_DIR/$DATE/${conf[1]} + scp -i $SSH_KEY ${conf[0]}@${conf[1]}:${conf[2]} $PULL_DIR/$DATE/${conf[1]} +done