1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

[fix] Restore data directory

This commit is contained in:
ljf (zamentur) 2020-09-20 18:36:20 +02:00 committed by GitHub
parent db53bc324d
commit a646f7648d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,18 +80,16 @@ chown -R $app:$app $final_path
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
# CREATE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Creating the data directory..." ynh_script_progression --message="Restoring data directory..." --weight=2
# Define app's data directory datadir="/home/yunohost.app/$app/storage"
datadir="/home/yunohost.app/${app}/storage"
if [ ! -d "$datadir" ] # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
then ynh_restore_file --origin_path="$datadir" --not_mandatory
# Create app folders
mkdir -p "$datadir" mkdir -p "$datadir"
fi
# Give permission to the datadir # Give permission to the datadir
chown -R "$app":"$app" "$datadir" chown -R "$app":"$app" "$datadir"