1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00
funkwhale_ynh/scripts/backup
eric_G 2372f1f4e9
Testing (#271)
* [autopatch] Automatic patch attempt for helpers 2.1 (#270)

* [autopatch] Automatic patch attempt for helpers 2.1

* Cleaning

* cleaning

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Auto-update READMEs

* Update manifest.toml

---------

Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2024-09-01 22:25:43 +02:00

55 lines
1.7 KiB
Bash

#!/bin/bash
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
ynh_print_info "Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup "$install_dir"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup "$data_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d"
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
ynh_backup "/etc/fail2ban/jail.d/$app.conf"
ynh_backup "/etc/fail2ban/filter.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup "/etc/systemd/system/${app}-beat.service"
ynh_backup "/etc/systemd/system/${app}-server.service"
ynh_backup "/etc/systemd/system/${app}-worker.service"
ynh_backup "/etc/systemd/system/$app.target"
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info "Backing up the PostgreSQL database..."
ynh_psql_dump_db > db.sql
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."