Symlinks not preserved by rsync when copying to cifs share

cifs

I have two servers, let's call them sA and sB. I need to backup data (several TBs) from sA to sB but because of problems with sB SSH, I'm using my local pc as "middle man". sA is a Linux server, sB is a QNAP nas.

So first I mount sB locally with

sudo mount -t cifs //sb_host/share destdir -o username=myuser,file_mode=0777,dir_mode=0777

Then I use rsync to copy files from sA to the share:

rsync -PrlH -e '/usr/bin/ssh' myremoteuser@sa_host:/dir-to-backup/ destdir

I had to remove the -a option because times and permissions couldn't be preserved. It's not a big deal (although it would be nice to fix that), but the same happens with symlinks:

rsync: symlink "symlink_file" -> "symlink_destination_file" failed: Operation not supported (95)

Can this be fixed?

Best Answer

I had tried "unix extensions = yes" but it didn't work - but it was just the nas overwriting the settings when restarted.

So, adding that option to the receiving server, restarting samba there and mounting share with cifs correctly handles permissions and symlinks.

Related Topic