Linux – Rsync to windows FTP over curlftpfs fails to set permissions

file-permissionsftplinuxrsyncwindows

I'm transferring some large files (1.5Gb) to a windows FTP server in a cronjob. It's going over a 2Mbit ADSL line, with 512Kbit upstream. So it takes forever, and can be prone to dropping to line.

I use a loop around rsync to do this

while ! rsync -q -P --append source ftp_dest; do
    sleep 60#give the line a chance to reset (which happens automatically)
done

This works to transfer the file, even with drops (I check the md5sums afterwards just in case). The problem comes at the very end of the process where rsync tries to set the destination file's permissions, which fails, because the underlying file system is NTFS.

EDIT:

I have added "–no-p –no-o –no-g –no-X –no-A" as per suggestion below, but still get the following error

rsync: ftruncate failed on "/mnt/ftpremote/test.bin": Operation not permitted (1)

This is not a problem, except that it causes my loop to continue forever. Is there a way to tell rsync to not attempt any permission setting at all? I've looked through the man page and not found anything (even if you tell it not to set permissions, it set's default permissions). I thought to use error codes, but the error code for the failed permissions setting is 23 (according to the man page "Partial transfer due to error"), which looks like it would be the code used if the line dropped anyway.

Best Answer

If the use of the full range of --no-p --no-A --no-X --no-o --no-g --no-D doesn't work, maybe you could alter your loop and use the result of the md5sum as the stop criterion, i.e. loop your rsync until the files are the same.