mirror of https://github.com/pikami/sysadmin.git
Create pull-backups.sh
This commit is contained in:
parent
527adc8555
commit
6b1670f9d7
|
@ -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
|
Loading…
Reference in New Issue