upgrade brain_backup script to handle include & exclude
This commit is contained in:
parent
888b155015
commit
a0fb7ff4bb
@ -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 ##
|
||||
|
7
templates/pxarexclude.j2
Normal file
7
templates/pxarexclude.j2
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
{% for item in backup_path %}
|
||||
{% if item.exclude }}{{ item.exclude }}{% endif %}
|
||||
{% endfor %}
|
||||
{% for item in backup_path %}
|
||||
!{{ item.value }}
|
||||
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user