fix the backup

This commit is contained in:
Kay0u 2020-12-18 22:33:22 +01:00
parent cecc78a652
commit 5952eb8feb
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -427,7 +427,6 @@ TEST_BACKUP_RESTORE () {
local main_result=0 local main_result=0
# Remove the previous residual backups # Remove the previous residual backups
sudo rm -rf ./ynh_backups
RUN_INSIDE_LXC rm -rf /home/yunohost.backup/archives RUN_INSIDE_LXC rm -rf /home/yunohost.backup/archives
# BACKUP # BACKUP
@ -446,7 +445,7 @@ TEST_BACKUP_RESTORE () {
[ $ret -eq 0 ] || main_result=1 [ $ret -eq 0 ] || main_result=1
# Grab the backup archive into the LXC container, and keep a copy # Grab the backup archive into the LXC container, and keep a copy
sudo lxc file pull -r $LXC_NAME/home/yunohost.backup/archives ./ynh_backups sudo lxc file pull -r $LXC_NAME/home/yunohost.backup/archives $TEST_CONTEXT/ynh_backups
# RESTORE # RESTORE
# Try the restore process in 2 times, first after removing the app, second after a restore of the container. # Try the restore process in 2 times, first after removing the app, second after a restore of the container.
@ -468,10 +467,10 @@ TEST_BACKUP_RESTORE () {
LOAD_LXC_SNAPSHOT snap0 LOAD_LXC_SNAPSHOT snap0
# Remove the previous residual backups # Remove the previous residual backups
RUN_INSIDE_LXC rm -f /rootfs/home/yunohost.backup/archives/* RUN_INSIDE_LXC rm -rf /home/yunohost.backup/archives
# Place the copy of the backup archive in the container. # Place the copy of the backup archive in the container.
sudo lxc file push -r ./ynh_backups/archives/* $LXC_NAME/home/yunohost.backup/archives/ sudo lxc file push -r $TEST_CONTEXT/ynh_backups/archives $LXC_NAME/home/yunohost.backup/
log_small_title "Restore on a fresh YunoHost system..." log_small_title "Restore on a fresh YunoHost system..."
fi fi