seafile_ynh/scripts/backup

37 lines
1,012 B
Text
Raw Normal View History

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
2017-07-21 14:56:41 +02:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
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
source ../settings/scripts/experimental_helper.sh
2017-07-21 14:56:41 +02:00
source ../settings/scripts/_common.sh
# Set configuration for user and final path
2017-07-21 14:56:41 +02:00
get_configuration
# 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)
#=================================================
# 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
# 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