mastodon_ynh/scripts/backup

45 lines
1.4 KiB
Text
Raw Permalink Normal View History

#!/bin/bash
2021-04-09 22:18:53 +00:00
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
2019-03-19 22:16:12 +00:00
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
2018-05-01 18:43:49 +00:00
ynh_print_info "Declaring files to be backed up..."
2018-05-01 18:43:49 +00:00
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup "$install_dir"
2018-05-01 18:43:49 +00:00
#=================================================
2025-11-08 14:50:43 +00:00
# BACKUP SYSTEM CONFIGURATION
2018-05-01 18:43:49 +00:00
#=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup "/etc/systemd/system/$app-web.service"
ynh_backup "/etc/systemd/system/$app-sidekiq.service"
ynh_backup "/etc/systemd/system/$app-streaming.service"
2018-05-01 18:43:49 +00:00
2025-11-08 14:50:43 +00:00
ynh_backup "/etc/logrotate.d/$app"
2018-11-07 04:12:21 +00:00
#=================================================
2022-01-07 00:25:26 +00:00
# BACKUP VARIOUS FILES
2018-11-07 04:12:21 +00:00
#=================================================
ynh_backup "/etc/cron.d/$app"
2018-11-07 04:12:21 +00:00
2018-05-01 18:43:49 +00:00
#=================================================
# BACKUP THE POSTGRESQL DATABASE
2018-05-01 18:43:49 +00:00
#=================================================
ynh_print_info "Backing up the PostgreSQL database..."
2018-06-21 02:48:02 +00:00
ynh_psql_dump_db > db.sql
2018-06-21 02:48:02 +00:00
2019-03-18 03:22:38 +00:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."