mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
64 lines
1.9 KiB
Bash
64 lines
1.9 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# MANAGE FAILURE OF THE SCRIPT
|
|
#=================================================
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
set -eu
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
if [ ! -e _common.sh ]; then
|
|
# Get the _common.sh file if it's not in the current directory
|
|
cp ../settings/scripts/_common.sh ./_common.sh
|
|
chmod a+rx _common.sh
|
|
fi
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
#=================================================
|
|
# STANDARD BACKUP STEPS
|
|
#=================================================
|
|
# BACKUP OF THE NGINX CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
#=================================================
|
|
# SPECIFIC BACKUP
|
|
#=================================================
|
|
# BACKUP TRANSMISSION CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_backup "/etc/transmission-daemon/settings.json"
|
|
|
|
#=================================================
|
|
# BACKUP DATA
|
|
#=================================================
|
|
|
|
ynh_backup "/usr/share/transmission"
|
|
|
|
ynh_backup "/var/lib/transmission-daemon"
|
|
|
|
backup_core_only=$(ynh_app_setting_get $app backup_core_only)
|
|
# If backup_core_only have a value in settings.yml, do not backup the data directory
|
|
if [ -z $backup_core_only ]
|
|
then
|
|
CHECK_SIZE "/home/yunohost.transmission"
|
|
ynh_backup "/home/yunohost.transmission"
|
|
else
|
|
echo "Data dir will not saved, because backup_core_only is set." >&2
|
|
fi
|