2015-12-26 14:14:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2015-12-26 14:14:31 +01:00
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Stop script if errors
|
|
|
|
ynh_abort_if_errors
|
2017-01-28 18:51:23 +01:00
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# Import common cmd
|
2018-02-11 01:20:58 +01:00
|
|
|
source ../settings/scripts/experimental_helper.sh
|
2017-07-21 14:56:41 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2016-12-27 10:44:40 +01:00
|
|
|
|
|
|
|
# Set configuration for user and final path
|
2017-07-21 14:56:41 +02:00
|
|
|
get_configuration
|
2016-12-27 10:44:40 +01:00
|
|
|
|
2015-12-26 14:14:31 +01:00
|
|
|
# retrieve useful param
|
2017-07-21 14:56:41 +02:00
|
|
|
domain=$(ynh_app_setting_get ${app} domain)
|
|
|
|
db_pwd=$(ynh_app_setting_get ${app} mysqlpwd)
|
2015-12-26 14:14:31 +01:00
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
# # Backup app files
|
|
|
|
ynh_backup $final_path
|
|
|
|
ynh_backup /home/yunohost.app/seafile-data "data" 1
|
2017-08-09 15:34:10 +02:00
|
|
|
ynh_backup /etc/nginx/conf.d/$domain.d/${app}.conf
|
2017-07-21 14:56:41 +02:00
|
|
|
ynh_backup /etc/init.d/seafile-server
|
2015-12-26 14:14:31 +01:00
|
|
|
|
|
|
|
# Backup mysql
|
2017-07-21 14:56:41 +02:00
|
|
|
ynh_mysql_dump_db ccnetdb > ${YNH_CWD}/ccnetdb.dmp
|
|
|
|
ynh_mysql_dump_db seafiledb > ${YNH_CWD}/seafiledb.dmp
|
|
|
|
ynh_mysql_dump_db seahubdb > ${YNH_CWD}/seahubdb.dmp
|