2016-05-14 10:06:20 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-05-17 22:13:59 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -eu
|
2016-05-14 10:06:20 +02:00
|
|
|
|
|
|
|
# Source YNH helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Get app instance name
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Retrieve arguments
|
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
|
|
|
|
# Backup directory location for the app from where the script is executed and
|
|
|
|
# which will be compressed afterward
|
|
|
|
backup_dir=$YNH_APP_BACKUP_DIR
|
|
|
|
|
|
|
|
# Backup sources & data
|
|
|
|
ynh_backup "/home/yunohost.transmission" "data"
|
|
|
|
ynh_backup "/usr/share/transmission" "sources"
|
|
|
|
|
|
|
|
# Copy configuration files
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/nginx.conf"
|
2016-05-17 22:13:59 +02:00
|
|
|
ynh_backup "/etc/transmission-daemon/settings.json" "conf/transmission.json"
|