From f47d6bcebb2bff84e801b7781731815868c825e7 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Tue, 24 Dec 2024 09:54:15 +0100 Subject: [PATCH] template brain_backup - handle var condition correctly --- templates/brain_backup.j2 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/brain_backup.j2 b/templates/brain_backup.j2 index 4824c69..f1f2015 100644 --- a/templates/brain_backup.j2 +++ b/templates/brain_backup.j2 @@ -60,7 +60,6 @@ mkdir -p $backup_dir/$today/mysql for db in $mysql_databases; do mysqldump -e -q -Q --lock-tables $db | gzip -c > $backup_dir/$today/mysql/dump_$db.sql.gz; done - ## end of mysql ## {% endif %} @@ -85,15 +84,15 @@ find $backup_dir -type d -ctime +$backup_local_retention -exec rm -rf {} \; ## send to PBS ## /usr/bin/proxmox-backup-client backup slash.pxar:/ \ -{% if backup_path_include %} +{% if backup_path_include is defined %} {% for item in backup_path_include %} {% if item.fs_mount %}--include-dev {{ item.path }} \{% endif %} {% endfor %} {% endif %} -{% if backup_pgsql_enabled %} +{% if backup_pgsql_enabled is sameas true %} postgresql.pxar:$backup_dir/$today/postgresql \ {% endif %} -{% if backup_mysql_enabled %} +{% if backup_mysql_enabled is sameas true %} mysql.pxar:$backup_dir/$today/mysql \ {% endif %} --rate ${PBS_RATE}