backup.sh: Add.

This commit is contained in:
lagertonne 2021-01-27 21:45:10 +01:00
parent ac3d83f5b1
commit c567f5d0b4

46
backup.sh Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash
LOG="backup.log"
HOST="fancy-hostname"
export REPOSITORY="ssh://<user>@<hostname>:<port>/some/example/path/"${HOST}
export BORG_PASSPHRASE=""
exec > >(tee -i ${LOG})
exec 2>&1
echo "###### Starting backup on $(date) ######"
##
## Creating database backup
##
#echo "###### Creating database backup ######"
#/home/serverbackup/backup/dbdump.sh
##
## Backup list of installed software
pacman -Qq > /root/backup/software.list
borg create -v --stats --progress \
$REPOSITORY::'{now:%Y-%m-%d_%H:%M}' \
/root/backup \
/home/user/ \
/home/user/.config \
/home/user/.thunderbird \
/home/user/.wireguard \
/home/user/.ssh \
/home/user/.vim \
/home/user/.mozilla \
/home/user/. \
/etc \
--exclude-caches \
-e /home/user/Downloads \
-e /home/user/vmware \
-e /home/user/Virtualbox\ VMs \
-e /home/user/Nextcloud\* \
-e /home/user/Finf-Nextcloud \
-e /home/user/Videos \
-e /home/user/.\* \
echo "###### Finished backup on $(date) ######"