Add backup core only feature

This commit is contained in:
Josué Tille 2020-11-29 17:29:51 +01:00
parent c6b4402161
commit e5b722e7e5
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
3 changed files with 31 additions and 3 deletions

View file

@ -101,6 +101,30 @@ From command line:
`sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh` `sudo yunohost app upgrade seafile -u https://github.com/YunoHost-Apps/seafile_ynh`
Backup
------
This app use now the core-only feature of the backup. To keep the integrity of the data and to have a better guarantee of the restoration is recommended to proceed like this:
- Stop seafile service with theses following command:
```
systemctl stop seafile.service seahub.service
```
- Launch the backup of seafile with this following command:
```
yunohost backup create --app seafile
```
- Do a backup of your data with your specific strategy (could be with rsync, borg backup or just cp).
- Restart the seafile service with theses command:
```
systemctl start seafile.service seahub.service
```
Remove
------
Due of the backup core only feature the data directory in `/home/yunohost.app/seafile-data` **is not removed**. It need to be removed manually to purge app user data.
Developers infos Developers infos
---------------- ----------------

View file

@ -22,6 +22,10 @@ db_pwd=$(ynh_app_setting_get --app $app --key mysqlpwd)
final_path=$(ynh_app_setting_get --app $app --key final_path) final_path=$(ynh_app_setting_get --app $app --key final_path)
seafile_user=$app seafile_user=$app
if [ ! "$(systemctl status seafile)" =~ "Active: stoped" ] || [ ! "$(systemctl status seahub)" =~ "Active: stoped" ]; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stoped. Please seafile service and seahub service with this command before to run the backup 'systemctl stop seafile.service seahub.service'"
fi
#================================================= #=================================================
# STANDARD BACKUP STEPS # STANDARD BACKUP STEPS
#================================================= #=================================================
@ -30,7 +34,7 @@ seafile_user=$app
ynh_script_progression --message="Backing up code..." --weight=3 ynh_script_progression --message="Backing up code..." --weight=3
ynh_backup --src_path $final_path ynh_backup --src_path $final_path
ynh_script_progression --message="Backing up user data..." --weight=10 ynh_script_progression --message="Backing up user data..." --weight=10
ynh_backup --src_path /home/yunohost.app/seafile-data --dest_path "data" ynh_backup --src_path /home/yunohost.app/seafile-data --dest_path "data" --is_big 1
ynh_script_progression --message="Backing up configuration..." ynh_script_progression --message="Backing up configuration..."
ynh_backup --src_path /etc/nginx/conf.d/$domain.d/${app}.conf ynh_backup --src_path /etc/nginx/conf.d/$domain.d/${app}.conf
ynh_backup --src_path /etc/systemd/system/seafile.service ynh_backup --src_path /etc/systemd/system/seafile.service

View file

@ -44,8 +44,6 @@ ynh_secure_remove --file=/var/log/seafile
ynh_script_progression --message="Removing code..." ynh_script_progression --message="Removing code..."
ynh_secure_remove --file=/var/www/$app ynh_secure_remove --file=/var/www/$app
ynh_secure_remove --file=/opt/yunohost/$app ynh_secure_remove --file=/opt/yunohost/$app
ynh_script_progression --message="Removing user data..."
ynh_secure_remove --file=/home/yunohost.app/seafile-data
ynh_secure_remove --file=/tmp/seahub_cache ynh_secure_remove --file=/tmp/seahub_cache
# Remove databases # Remove databases
@ -82,4 +80,6 @@ ynh_script_progression --message="Removing seafile service..."
yunohost service remove seafile yunohost service remove seafile
yunohost service remove seahub yunohost service remove seahub
ynh_print_info --message="Due of the backup core only feature the data directory in '/home/yunohost.app/seafile-data' was not removed. It need to be removed manually to purge app user data."
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression --message="Removal of $app completed" --last