Revise backup-pm-home.sh for varying hostnames

This commit is contained in:
Tony Garnock-Jones 2022-10-11 13:51:23 +02:00
parent ed563ed798
commit ec44e25699
1 changed files with 5 additions and 2 deletions

View File

@ -1,11 +1,14 @@
#!/bin/sh #!/bin/sh
# 2021-11-10 # 2021-11-10
# revised 2022-01-06 for multiple devices # revised 2022-01-06 for multiple devices
# revised 2022-10-11 for varying hostnames
set -e set -e
set -u set -u
eval "$(ssh pm-rndis cat /etc/deviceinfo)" DEVICEHOSTNAME=${1:-pm-usb0}
eval "$(ssh ${DEVICEHOSTNAME} cat /etc/deviceinfo)"
if [ -z "${deviceinfo_codename}" ] if [ -z "${deviceinfo_codename}" ]
then then
@ -39,7 +42,7 @@ one_fs 1
sync_first 1 sync_first 1
backup user@pm-rndis:/home/user ./ backup user@${DEVICEHOSTNAME}:/home/user ./
EOF EOF
rsnapshot -c ${rsnapshot_conf} sync rsnapshot -c ${rsnapshot_conf} sync