parent
7ea9e94e8e
commit
2808014096
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories
|
||||
# https://linuxhandbook.com/bash-arrays/
|
||||
# https://stackoverflow.com/a/169517
|
||||
|
||||
remotedirs=('bookstack' 'gitea')
|
||||
|
||||
# Server must have an ssh entry set up in ~/.ssh/config with the
|
||||
# host, user, port (if non-standard), and identityFile.
|
||||
server="vps-b"
|
||||
remotehome="~"
|
||||
localhome="/mnt/b/Backups"
|
||||
|
||||
let mydirs="${#remotedirs[@]}-1"
|
||||
|
||||
for i in $(seq 0 $mydirs); do
|
||||
echo "Downloading $server:$remotehome/${remotedirs[$i]}/ to $localhome/${remotedirs[$i]}/..."
|
||||
rsync -a $server:$remotehome/${remotedirs[$i]}/ $localhome/${remotedirs[$i]}/
|
||||
done
|
Loading…
Reference in new issue