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

56 lines
1.7 KiB
Text
Raw Normal View History

2018-05-11 21:38:56 +02:00
#!/bin/bash
2019-04-03 14:35:09 +02:00
source ../settings/scripts/_common.sh
2018-05-11 21:38:56 +02:00
source /usr/share/yunohost/helpers
ynh_print_info "Declaring files to be backed up..."
2020-12-04 16:56:37 +01:00
2018-05-11 21:38:56 +02:00
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup "$install_dir"
2018-05-11 21:38:56 +02:00
2021-08-04 23:53:34 +02:00
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup "$data_dir"
2021-08-04 23:53:34 +02:00
2018-05-11 21:38:56 +02:00
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d"
2018-05-11 21:38:56 +02:00
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
2018-05-11 21:38:56 +02:00
#=================================================
ynh_backup "/etc/fail2ban/jail.d/$app.conf"
ynh_backup "/etc/fail2ban/filter.d/$app.conf"
2018-05-11 21:38:56 +02:00
#=================================================
# 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"
2019-04-03 14:35:09 +02:00
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info "Backing up the PostgreSQL database..."
ynh_psql_dump_db > db.sql
2019-04-03 14:35:09 +02:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."