#993 Issue closed: rsync - full path lost

Labels: support / question, fixed / solved / done

pmurphree opened issue at 2016-08-31 20:08:

Relax-and-Recover 1.17.2 / Git
OS_VENDOR=RedHatEnterpriseServer
OS_VERSION=6

local.conf
OUTPUT=ISO
OUTPUT_URL=nfs://172.21.24.126/archive/share
BACKUP=NETFS
BACKUP_URL=nfs://172.21.24.126/archive/share
BACKUP_PROG=rsync
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_PROG_EXCLUDE=( '/archive/' '/dev/' '/tmp/' '/dev/shm/' '/var/lib/rear/output/' '/mnt/backup/' '/archive/share/' '/usr/local/pgsql/data/' )

partitions not mounted under more than one directory chain, results in rsync creating directory in / with out the full directory chain.

example:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 279.4G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 278.4G 0 part
├─vg_nsc-lv_root (dm-0) 253:0 0 48.8G 0 lvm /
├─vg_nsc-lv_db (dm-1) 253:1 0 91.6G 0 lvm /usr/local/pgsql
├─vg_nsc-lv_log (dm-2) 253:2 0 14.6G 0 lvm /var/log
└─vg_nsc-lv_archive (dm-3) 253:3 0 123.4G 0 lvm /archive

after rsync, the backup contains a directory under / with pgsql and the data from /usr/local/pgsql

This happens for /var/log as well. A directory named log is created under /, with the contents of /var/log.

pmurphree commented at 2016-08-31 20:13:

looking at /usr/share/rear/backup/NETFS/default/50_make_backup.sh:

            $BACKUP_PROG  $v "${BACKUP_RSYNC_OPTIONS[@]}" --one-file-system --delete \
                    --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \
                    $(cat $TMP_DIR/backup-include.txt) "$backuparchive"

this builds a rsync command of:

cat backup.log
mkdir: created directory `/tmp/rear.gnkHiicgvUruz74/outputfs/backfort-g9/backup'
2016-08-31 15:47:33.022601207 rsync -v --sparse --archive --hard-links --numeric-ids --stats --one-file-system --delete --exclude-from=/tmp/rear.gnkHiicgvUruz74/tmp/backup-exclude.txt --delete-excluded /archive /usr/local/pgsql /var/log / /boot /tmp/rear.gnkHiicgvUruz74/outputfs/backfort-g9/backup

which to me shows that each mount point will get dumped in / under a directory named for the last word in the directory name given.

gdha commented at 2016-09-01 08:43:

The same issue was report under #871 - fix is in the unstable release and in the upcoming 1.19 release.

jsmeix commented at 2016-09-28 13:10:

I close it because the issue is set to "fixed".
If needed it can be reopenend.


[Export of Github issue for rear/rear.]