#383 Issue closed: BUILD_DIR removal can result in unwanted file deletion over NFS

Labels: waiting for info, support / question

toomaskiisk opened issue at 2014-03-28 11:51:

function cleanup_build_area_and_end_program() in framework-functions.sh contains following line:

            rm -Rf $BUILD_DIR/outputfs

When using NFS target, BUILD_DIR is the same as BACKUP_URL. It happened that BUILD_DIR was still mounted when this command was run, resulting in loss of all files there. I'm unable to reproduce it right now but it certainly happened several times. I was also having trouble with poor NFS server response time at the same time, maybe this caused some unusual code path to be run. Not sure why but it can cause cause unwanted deletes, Maybe BUILD_DIR should point to temporary location, not to backup destination.

gdha commented at 2014-04-01 07:55:

The BUILD_DIR is defined in ./rear:BUILD_DIR="$(mktemp -d -t rear.XXXXXXXXXXXXXXX)"

++ [[ -d /tmp/rear.qP5aLwuy8VgZeMv/outputfs/fedora20 ]]
++ rmdir -v /tmp/rear.qP5aLwuy8VgZeMv/outputfs
rmdir: removing directory, '/tmp/rear.qP5aLwuy8VgZeMv/outputfs'

According an earlier mail from you:

OUTPUT_URL=file:///backup/
BACKUP=NETFS
BACKUP_URL=nfs://nfs.host.uu/some/dir

The OUTPUT_URL was not going to NFS, but a local file system. However, if I understood it well /backup is a NFS mounted file system. What you should do is or unset OUTPUT_URL or define a proper nfs mount point

gdha commented at 2014-04-16 12:14:

@toomaskiisk could you please comment?

toomaskiisk commented at 2014-04-16 12:43:

removed OUTPUT_URL parameter and I'm doing backup to mounted NFS share (BACKUP_URL=file:///...). It works too, but I need to mount correct NFS directory manually before recover. That's all.


[Export of Github issue for rear/rear.]