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

Merge pull request #18 from YunoHost-Apps/enh_dont_backup__data

Don't backup _data temporary folder (closes #17)
This commit is contained in:
JimboJoe 2018-01-31 08:10:54 +01:00 committed by GitHub
commit 769977de6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -42,7 +42,7 @@ ynh_backup "$final_path"
backup_core_only=$(ynh_app_setting_get "$app" backup_core_only)
if [ -z $backup_core_only ] # If backup_core_only setting set, don't backup data directory
then
ynh_backup /home/yunohost.app/${app}
ynh_backup /home/yunohost.app/${app}/upload
else
echo "Data dir won't be saved, because backup_core_only is set." >&2
# Remove the option so that next regular backup will be complete

View file

@ -54,12 +54,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file "$final_path"
# Restore data directory if backed-up
if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}" ] ; then
ynh_restore_file "/home/yunohost.app/${app}"
if [ -d "$YNH_BACKUP_DIR/apps/${app}/backup/home/yunohost.app/${app}/upload" ] ; then
ynh_restore_file "/home/yunohost.app/${app}/upload"
else
# Create app folders
mkdir /home/yunohost.app/${app}/_data /home/yunohost.app/${app}/upload
# Create app data folder
mkdir /home/yunohost.app/${app}/upload
fi
# Create temporary data folder
mkdir -p /home/yunohost.app/${app}/_data
# Remove the option backup_core_only if it's in the settings.yml file
ynh_app_setting_delete $app backup_core_only