From 4dfe2759421883575d4a63d2879d58b93bc56f6a Mon Sep 17 00:00:00 2001 From: magikcypress Date: Mon, 10 Apr 2017 04:55:10 +0200 Subject: [fix] install + add file remove/restore/upgrade --- scripts/backup | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/backup (limited to 'scripts/backup') diff --git a/scripts/backup b/scripts/backup new file mode 100644 index 0000000..2ef6b86 --- /dev/null +++ b/scripts/backup @@ -0,0 +1,30 @@ +#!/bin/bash + +# Exit on command errors and treat unset variables as an error +set -eu + +# Get multi-instances specific variables +app=$YNH_APP_INSTANCE_NAME + +# Source app helpers +source /usr/share/yunohost/helpers + +# Retrieve app settings +domain=$(ynh_app_setting_get "$app" domain) + +# Copy the app files +final_path="/opt/${app}" +ynh_backup "$final_path" "sources" 1 + +# Copy the nginx conf files +ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" +ynh_backup "/etc/cron.d/${app}.conf" "cron.conf" +ynh_backup "/etc/systemd/system/mastodon-web.service" "systemd_web.service" +ynh_backup "/etc/systemd/system/mastodon-sidekiq.service" "systemd_sidekiq.service" +ynh_backup "/etc/systemd/system/mastodon-streaming.service" "systemd_streaming.service" + +# Backup db +sudo su - postgres < /home/backup/mastodon_db.sql +COMMANDS +ynh_backup "/home/backup/mastodon_db.sql" "mastodon_db.sql" \ No newline at end of file -- cgit v1.2.3-70-g09d2