[fix] Backup fails because output directory not empty #672
c.f. YunoHost/issues#1308 which sometime breaks upgrade for silly reasons
Implement the 'FIXME' by attempting to unmount / clean the directory.
While fixing this, I realized that the function
Tested and works okay
How to test
# Initialize dummy file mkdir /var/toto echo "toto" > /var/toto/toto # Initialize dummy tmp directory cd /home/yunohost.backup/tmp mkdir yoloswag; cd yoloswag # Mount dummy stuff in the tmp directory mkdir toto mount -o ro,bind /var/toto ./toto # Try to create a backup cd yunohost backup create -n yoloswag --debug
Should see in the debug output (at the beginning) that it complains the directory ain't empty and attempts to clean it