improved exclude file. \nIntroduced BACKUP_PATH variable. Everythings is modulargit add backup.env.sample make_backup.sh

This commit is contained in:
Rabjerg
2021-03-17 00:08:42 +01:00
parent 0381289497
commit 118507da41
3 changed files with 13 additions and 2 deletions

View File

@@ -1,5 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
## BACKUP_PATH is a list of paths to backup, seperated by a space.
## If there is a spaces in your path (shame on you), escape them first.
## Like this:
# BACKUP_PATH="/home/use/first\ path\ with\ spaces /home/user/second_path /home/user/third_path"
# BACKUP_PATH="/home/user/just_one_path"
## In the sample only /home is being backed up.
BACKUP_PATH="/home"
## Backup exclude is a file containing paths that should be backed up, like pseudo filesystems.
BACKUP_EXCLUDE="backup_exclude.txt.sample"
## Setup Path and file for logging ## Setup Path and file for logging
LOGPATH="/var/log/borg" LOGPATH="/var/log/borg"

View File

@@ -33,9 +33,9 @@ fi
echo "######## Backup started at $(date) ########" echo "######## Backup started at $(date) ########"
borg create -v --stats \ borg create -v --stats \
--exclude-from backup_exclude.txt \ --exclude-from $BACKUP_EXCLUDE \
$REPOSITORY::$BACKUP_NAME \ $REPOSITORY::$BACKUP_NAME \
/home/adam/docker $BACKUP_PATH
echo "######### Backup Finished $(date) #########" echo "######### Backup Finished $(date) #########"