mirror of
https://github.com/YunoHost-Apps/paheko_ynh.git
synced 2024-09-03 19:56:22 +02:00
secure temporary directory for data
This commit is contained in:
parent
38f13283f3
commit
74cd032fef
1 changed files with 4 additions and 3 deletions
|
@ -35,7 +35,8 @@ fi
|
||||||
ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5
|
ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5
|
||||||
|
|
||||||
# copy data directory backup
|
# copy data directory backup
|
||||||
cp -a $install_dir/data /tmp/data
|
file=$(mktemp -d $app_dataXXX --suffix=BKP)
|
||||||
|
cp -a $install_dir/data /var/www/$file
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -90,7 +91,7 @@ ynh_add_config --template="config.local.yunohost.php" --destination="$install_di
|
||||||
ynh_script_progression --message="Restore datas..." --weight=5
|
ynh_script_progression --message="Restore datas..." --weight=5
|
||||||
|
|
||||||
# Sync data directory backup
|
# Sync data directory backup
|
||||||
rsync -R /tmp/data/ $install_dir/data/
|
rsync -R /var/www/$file/ $install_dir/data/
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIX PERMISSIONS
|
# FIX PERMISSIONS
|
||||||
|
@ -119,7 +120,7 @@ ynh_local_curl "/index.php"
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# remove directory duplicated
|
# remove directory duplicated
|
||||||
ynh_secure_remove --file="/tmp/data"
|
ynh_secure_remove --file="/var/www/$file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue