Parcourir la source

fcn-backup: permet de configurer les répertoires inclus dans la sauvegarde

Guillaume il y a 7 ans
Parent
commit
932d9e6a77
2 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 5 2
      backup.cfg.example
  2. 1 1
      fcn-backup

+ 5 - 2
backup.cfg.example

@@ -1,5 +1,8 @@
+# Directories to backup
+BACKUP_DIR_INCL="/etc /var/mail"
+
 # Local backup destination
-LOCAL_DIR=/path/to/backups
+LOCAL_DIR=/var/backups
 
 # Remote backup destination
 REMOTE_ENABLE=true
@@ -7,4 +10,4 @@ REMOTE_USER=backupuser
 REMOTE_HOSTNAME=backupotron5000.example.net
 
 # PostgreSQL backup options
-#PGSQL_EXCLUDE_DATNAME=['template_']
+#PGSQL_EXCLUDE_DATNAME="['template_']"

+ 1 - 1
fcn-backup

@@ -79,7 +79,7 @@ if [ ! -d "${BACKUP_DEST}" ]; then
 fi
 
 # Do local backup
-borg create --exclude-from /etc/fcn-toolbox/backup.exclude ${BACKUP_DEST}::${BACKUP_NAME} "/etc" "${BACKUP_TEMP}"
+borg create --exclude-from /etc/fcn-toolbox/backup.exclude ${BACKUP_DEST}::${BACKUP_NAME} "${BACKUP_TEMP}" ${BACKUP_DIR_INCL}
 
 # Prune local archives to keep only 7 daily, and 4 weekly, and 3 monthly ones
 borg prune --keep-daily=7 --keep-weekly=4 --keep-monthly=3 ${BACKUP_DEST}