diff --git a/templates/brain_backup.j2 b/templates/brain_backup.j2 index b543956..a41d74f 100644 --- a/templates/brain_backup.j2 +++ b/templates/brain_backup.j2 @@ -84,14 +84,17 @@ sudo su - postgres -c "/usr/bin/pg_dumpall --roles-only > $backup_dir/$today/pos find $backup_dir -type d -ctime +$backup_retention -exec rm -rf {} \; ## send to PBS ## -# TODO : this need to be templified ! -/usr/bin/proxmox-backup-client backup system.pxar:$backup_dir/$today/system --rate ${PBS_RATE} -/usr/bin/proxmox-backup-client backup etc.pxar:/etc/ --rate ${PBS_RATE} -/usr/bin/proxmox-backup-client backup var_www.pxar:/var/www/ --rate ${PBS_RATE} --exclude 'html' --exclude 'lost+found' --exclude='*.sock' --exclude='*.log' --exclude='.cache/' -/usr/bin/proxmox-backup-client backup opt.pxar:/opt/ --rate ${PBS_RATE} -/usr/bin/proxmox-backup-client backup mysql.pxar:$backup_dir/$today/mysql --rate ${PBS_RATE} -/usr/bin/proxmox-backup-client backup postgresql.pxar:$backup_dir/$today/postgresql --rate ${PBS_RATE} -/usr/bin/proxmox-backup-client backup slash.pxar:/ --rate ${PBS_RATE} --include-dev /opt/docker-compose --include-dev /home +/usr/bin/proxmox-backup-client backup slash.pxar:/ \ +{% for item in backup_path %} +{% if item.fs_mount }}--include-dev {{ item.path }} \{% endif %} +{% endfor %} +{% if backup_pgsql_enabled %} +postgresql.pxar:$backup_dir/$today/postgresql \ +{% endif %} +{% if backup_mysql_enabled %} +mysql.pxar:$backup_dir/$today/mysql \ +{% endif %} +--rate ${PBS_RATE} ## end of send to PBS ## ## PBS logout ## diff --git a/templates/pxarexclude.j2 b/templates/pxarexclude.j2 new file mode 100644 index 0000000..459d72b --- /dev/null +++ b/templates/pxarexclude.j2 @@ -0,0 +1,7 @@ +/* +{% for item in backup_path %} +{% if item.exclude }}{{ item.exclude }}{% endif %} +{% endfor %} +{% for item in backup_path %} +!{{ item.value }} +{% endfor %}