1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
rainloop_ynh/scripts/backup
scith 90a70807ad Major Rainloop update
- Backup/restore scripts
- Updated to YNH 2.4
- Fetch from source and integrity check
- Remove autoversion (not needed)
- Remove ynh_login_mapping (creates LDAP errors plus is it really
needed?). The plugin is still installed but not activated
- Domain hooks
- Backup before upgrade, restore if fail
- Remove disabled domains (users may want to add gmail addresses)
- Added auto-domain-grab plugin with wildcard domain. Users can try to
add aliases without admin config
- Add the admin password in config in case the password is lost
2016-12-18 01:13:17 +01:00

27 lines
647 B
Bash

#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
app=$YNH_APP_INSTANCE_NAME
# Set app specific variables
dbname=$app
dbuser=$app
# Source app helpers
. /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
# Copy the app files
DESTDIR="/var/www/$app"
ynh_backup "$DESTDIR" "sources"
# Copy the conf files
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
# Dump the database
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./dump.sql