add sshportal backup

This commit is contained in:
Ludovic Cartier
2026-05-27 18:42:30 +02:00
parent 7a953d3b77
commit 0df97444c7
2 changed files with 33 additions and 0 deletions
+19
View File
@@ -221,6 +221,22 @@ fi
## end of gitea ##
{% endif %}
{% if backup_sshportal_enabled is sameas true %}
## sshportal ##
backup_sshportal_db_path="{{ backup_sshportal_db_path | default('/var/lib/docker/volumes/sshportal__var_lib_sshportal/_data/sshportal.db') }}"
backup_sshportal_ssh_host="{{ backup_sshportal_ssh_host | default('localhost') }}"
backup_sshportal_ssh_port="{{ backup_sshportal_ssh_port | default('2222') }}"
backup_sshportal_ssh_user="{{ backup_sshportal_ssh_user | default('admin') }}"
backup_sshportal_ssh_key="{{ backup_sshportal_ssh_key | default('/opt/docker-compose/sshportal/ed25519_sshportal_admin') }}"
mkdir -p "$backup_dir/$today/sshportal"
/usr/bin/sqlite3 "$backup_sshportal_db_path" .dump > "$backup_dir/$today/sshportal/sshportal.sql.bkp"
/usr/bin/ssh -i "$backup_sshportal_ssh_key" -p "$backup_sshportal_ssh_port" -l "$backup_sshportal_ssh_user" "$backup_sshportal_ssh_host" config backup > "$backup_dir/$today/sshportal/backup.json"
## end of sshportal ##
{% endif %}
# purge old backups
find $backup_dir -type d -ctime +$backup_local_retention -exec rm -rf {} \;
@@ -253,6 +269,9 @@ mariadb.pxar:$backup_dir/$today/mariadb \
{% if backup_gitea_enabled is sameas true %}
gitea.pxar:$backup_dir/$today/gitea \
{% endif %}
{% if backup_sshportal_enabled is sameas true %}
sshportal.pxar:$backup_dir/$today/sshportal \
{% endif %}
--rate ${PBS_RATE}
## end of send to PBS ##