1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

[enh] Add *untested* backup scripts.

This commit is contained in:
opi 2014-11-04 00:19:38 +01:00
parent e58212bc8b
commit 4d43a4d4c6
2 changed files with 28 additions and 0 deletions

14
scripts/backup Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
# The parameter $1 is the backup directory location
# which will be compressed afterward
backup_dir=$1/apps/dokuwiki
mkdir -p $backup_dir
# Backup sources & data
sudo cp -a /var/www/dokuwiki/. $backup_dir/sources
# Copy Nginx and YunoHost parameters to make the script "standalone"
sudo cp -a /etc/yunohost/apps/dokuwiki/. $backup_dir/yunohost
domain=$(sudo yunohost app setting dokuwiki domain)
sudo cp -a /etc/nginx/conf.d/$domain.d/dokuwiki.conf $backup_dir/nginx.conf

14
scripts/restore Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
# The parameter $1 is the uncompressed restore directory location
backup_dir=$1/apps/dokuwiki
# Restore sources & data
sudo cp -a $backup_dir/sources/. /var/www/dokuwiki
# Copy Nginx and YunoHost parameters to make the script "standalone"
sudo cp -a $backup_dir/yunohost/. /etc/yunohost/apps/dokuwiki
domain=$(sudo yunohost app setting dokuwiki domain)
sudo cp -a $backup_dir/nginx.conf /etc/nginx/conf.d/$domain.d/dokuwiki.conf
sudo service nginx restart