improved exclude file. \nIntroduced BACKUP_PATH variable. Everythings is modulargit add backup.env.sample make_backup.sh
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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) #########"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user