#366 Issue closed: RSYNC: 90_copy_result_files.sh syntax error

Labels: bug

gdha opened issue at 2014-02-18 08:12:

There seems to be 2 copy_result_files.sh scripts! The first contains a syntax error and the second bails out with a bizarre message (the BACKUP_URL syntax was correct - still old style).

2014-02-17 16:32:20 Including output/RSYNC/default/90_copy_result_files.sh
2014-02-17 16:32:20 Copying resulting files to gdhaese1@witsbebelnx02:/home/gdhaese1/backup/rsync location
2014-02-17 16:32:20 Copying files '/var/lib/rear/output/rear-fedora20.iso' to gdhaese1@witsbebelnx02:/home/gdhaese1/backup/rsync location
'/var/lib/rear/output/rear-fedora20.iso' -> '/tmp/rear.LDo1VMOvTt4dtwl/tmp/rsync/fedora20/rear-fedora20.iso'
/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh: line 16: unexpected EOF while looking for matching `)'
/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh: line 36: syntax error: unexpected end of file
2014-02-17 16:32:21 Including output/default/94_grub_rescue.sh
2014-02-17 16:32:21 Including output/default/95_copy_result_files.sh
2014-02-17 16:32:21 Copying resulting files to rsync location
2014-02-17 16:32:21 Copying files '/var/lib/rear/output/rear-fedora20.iso' to rsync location
ERROR: The remote path must start with a module name not a /
rsync error: error starting client-server protocol (code 5) at main.c(1635) [sender=3.1.0]
2014-02-17 16:32:21 ERROR: Problem transferring files to gdhaese1@witsbebelnx02:/home/gdhaese1/backup/rsync

As this must be there for at least since 2012 we may assume that RSYNC as backup method is not used very often.... see also issue #200 - perhaps we could redesign the rule sets in the meantime.

gdha commented at 2014-02-19 10:37:

another bug found in script ./prep/RSYNC/default/15_check_rsync_protocol_version.sh

 _mntpt=$(ssh ${RSYNC_USER}@${RSYNC_HOST} 'cd ${RSYNC_PATH}; df -P .' 2>/dev/null | tail -1 | awk '{print $6}')
 ssh ${RSYNC_USER}@${RSYNC_HOST} mount 2>/dev/null | grep "$_mntpt" | grep -q user_xattr
 StopIfError "Remote file system $_mntpt does not have user_xattr mount option set!"

the second line shows 2 mount points and not only the $_mntpt:

# ssh gdhaese1@witsbebelnx02 mount 2>/dev/null | grep "$_mntpt" | grep user_xattr
/dev/mapper/vg00-lv00 on / type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw,acl,user_xattr)

in our case the / was the one and more important the option user_xattr was not defined which resulted in errors messages in the log file, such as:

rsync: failed to write xattr user.rsync.%stat for ....

gdha commented at 2014-02-19 13:52:

with user_xattr enabled (on remote linux system) we still see errors like:
rsync: rsync_xal_set: lsetxattr("etc/alternatives/faked.nl.1.gz","user.rsync.security.selinux") failed: Operation not permitted (1)

in script ./prep/RSYNC/default/15_check_rsync_protocol_version.sh we have
BACKUP_RSYNC_OPTIONS=( "${BACKUP_RSYNC_OPTIONS[@]}" --xattrs --rsync-path="""rsync --fake-super""" ) and according http://serverfault.com/questions/119846/rsync-and-fake-super-how-to-preserve-attributes we should remove the --xattrs from the BACKUP_RSYNC_OPTIONS. Testing proofs this is correct ...


[Export of Github issue for rear/rear.]