1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00

fix backup script

This commit is contained in:
eoli3n 2020-01-05 17:51:02 +01:00
parent d77a8a141d
commit 428385393a

@ -6,7 +6,7 @@ SERVER=root@neon
ROOT=/home ROOT=/home
REPOSITORY=$SERVER:$DIR REPOSITORY=$SERVER:$DIR
if [[ ! $(ssh $SERVER exit) ]] if ! ssh $SERVER exit
then then
echo "Can't connect to server" echo "Can't connect to server"
exit exit
@ -15,9 +15,10 @@ fi
if [[ $1 == "list" ]] if [[ $1 == "list" ]]
then then
ssh $SERVER BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $DIR ssh $SERVER BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $DIR
exit
fi fi
if [[ ! $(ssh $SERVER BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $DIR) ]] if ! ssh $SERVER BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $DIR
then then
ssh $SERVER mkdir -p $DIR ssh $SERVER mkdir -p $DIR
borg init --encryption=repokey-blake2 $REPOSITORY borg init --encryption=repokey-blake2 $REPOSITORY