remove backup accounts and sync files

This commit is contained in:
mischa 2022-11-22 18:13:25 +01:00
parent 4ee4772e70
commit 08de93e3d6
1 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2019-2021 Mischa Peters <mischa @ openbsd.amsterdam>
# Copyright (c) 2019-2022 Mischa Peters <mischa @ openbsd.amsterdam>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@ -45,5 +45,12 @@ if vmctl show ${1%.txt} >/dev/null 2>&1; then
fi
fi
echo "NOTE: don't forget wm1";
if [[ "${SERVER}" == server* ]]; then
HOST="s${SERVER#server}"
elif [[ "${SERVER}" == mega* ]]; then
HOST="m${SERVER#mega}"
fi
openrsync -va --del /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/
ssh wm1.obsda.ms "doas userdel -r ${HOST}${1%.txt} && doas groupdel ${HOST}${1%.txt}"
openrsync -va --del /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/