47 lines
967 B
Bash
47 lines
967 B
Bash
|
#!/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) ######"
|