1

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.

2
  • Are you trying to set Unix permissions on a Windows file? Jan 13, 2013 at 20:25
  • No, the opposite in fact. I'm to get rsync not to set permissions or ownership, but despite passing the --no-* options, it still fruncates (which fails), and I can't figure out what it's trying to do or why.
    – sirlark
    Jan 15, 2013 at 7:42

1 Answer 1

0

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.

1
  • Hi, the --no-p --no-o --no-g did the job to get rid of the permissions error, but see my edits above. I'd like to avoid the md5sum if at all possible, because it means re-downloading the file to check the destination md5. Otherwise, I would mark it the correct solution. If I could get rid of the ftruncate error, I would have enough faith in the transfer. Thanks though
    – sirlark
    Jan 13, 2013 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .