diff --git a/manifest.json b/manifest.json index 5a3d7e8..82f6880 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,8 @@ }, "multi_instance": true, "services": [ - "python" + "nginx", + "mopidy" ], "arguments": { "install" : [ diff --git a/scripts/backup b/scripts/backup index 84dc0dc..58ada1a 100644 --- a/scripts/backup +++ b/scripts/backup @@ -3,25 +3,18 @@ # Exit on command errors and treat unset variables as an error set -eu -# The parameter $1 is the backup directory location dedicated to the app -backup_dir=$1 - -# The parameter $2 is theid of the app instance +# Get multi-instances specific variables app=$YNH_APP_INSTANCE_NAME # Source app helpers source /usr/share/yunohost/helpers -domain=$(ynh_app_setting_get $app domain) -final_path=$(ynh_app_setting_get $app final_path) +# Retrieve app settings +domain=$(ynh_app_setting_get "$app" domain) -# Copy the app web files -sudo mkdir -p ${backup_dir}/var/www -sudo cp -a $final_path "${backup_dir}/var/www/$app" -# Copy the music files -sudo mkdir -p ${backup_dir}/var/lib/$app/ -sudo cp -a $final_path "${backup_dir}/var/lib/$app" +# Copy the app files +final_path="/var/www/${app}" +ynh_backup "$final_path" "sources" 1 -# Copy the conf files -sudo mkdir -p "${backup_dir}/conf" -sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf "${backup_dir}/conf/nginx.conf" +# Copy the nginx conf files +ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" \ No newline at end of file