2

I have a strange issue with rsync: some files are not saved on the remote host.

On my Windows 2012 server i'm using:

rsync --progress --no-compress --partial -avshW "/cygdrive/d/foto" '[email protected]:/usb/backup' | wintee C:\BAT\logs\backup_foto.log 2>&1

I am getting output like this:

foto/2013/01/xx xx xx/IMG_5536.JPG
      32.77K   1%  189.35kB/s    0:00:11       1.15M  49%  921.05kB/s    0:00:01       2.26M  98%  221.09kB/s    0:00:00       2.29M 100%  224.34kB/s    0:00:09 (xfer#2, to-check=1304/35107)
foto/2013/01/xx xx xx/IMG_5537.JPG
      32.77K   1%    6.25MB/s    0:00:00     491.52K  15%  348.84kB/s    0:00:07       1.38M  42%  565.42kB/s    0:00:03       1.54M  47%  388.83kB/s    0:00:04       2.59M  79%  406.17kB/s    0:00:01       3.11M  95%  414.84kB/s    0:00:00       3.26M 100%  420.75kB/s    0:00:07 (xfer#3, to-check=1303/35107)
foto/2013/01/xx xx xx/IMG_5538.JPG
      32.77K   1%    1.95MB/s    0:00:01     360.45K  14%   75.86kB/s    0:00:26       1.41M  58%  195.29kB/s    0:00:05       2.41M 100%  301.40kB/s    0:00:07 (xfer#4, to-check=1302/35107)
foto/2013/01/xx xx xx/IMG_5539.JPG
      32.77K   1%   42.33kB/s    0:01:05      65.54K   2%   33.60kB/s    0:01:21     589.82K  21%  150.71kB/s    0:00:14       1.64M  58%  163.72kB/s    0:00:07       2.16M  77%  194.01kB/s    0:00:03       2.69M  95%  255.82kB/s    0:00:00       2.81M 100%  229.96kB/s    0:00:11 (xfer#5, to-check=1301/35107)
foto/2013/01/xx xx xx/IMG_5540.JPG
      32.77K   1%    2.60MB/s    0:00:01     393.22K  13%  359.21kB/s    0:00:06       1.28M  45%  603.19kB/s    0:00:02       1.97M  69%  421.33kB/s    0:00:02       2.49M  87%  388.68kB/s    0:00:00       2.83M 100%  440.40kB/s    0:00:06 (xfer#6, to-check=1300/35107)

However the files are never created on the remote host!

root@pinew:/usb/backup/foto/2013/01/xx xx xx# ls -al
total 8
drwx------ 2 matthijs matthijs 4096 Jan 27  2013 .
drwx------ 5 matthijs matthijs 4096 Jan 27  2013 ..

And to make it even stranger the 'foto' (photo) directory contains stuff like "2011" "2012" "2013" and for example the 2011 and 2012 directory ARE synced!

So: how is it possible that only one (or perhaps some more dir's I didn't find yet) directory is not pushed to the remote host?

Source: Windows 2012 server

Destination: Raspberry pi: Linux pinew.xxxx.nl 3.10.24+ #614 PREEMPT Thu Dec 19 20:38:42 GMT 2013 armv6l GNU/Linux

edit:

@rxt

Well wtf indeed the 2013 directory has other permissions than the other directories:

drwx------ 14 matthijs matthijs  4096 Aug 15  2012 2010
drwx------ 30 matthijs matthijs  4096 Aug 15  2012 2011
drwx------ 25 matthijs matthijs  4096 Mar 24  2013 2012
d--------- 16 matthijs matthijs  4096 Dec 22 12:33 2013

That's strange because i didn't create them rsync did. However when i remove the directory and restart the rsync job it get created again with the same permissions!

So I think the question is: why does 1 directory get different permissions then the others? I checked it on windows but they have the same security settings!

edit2:

Solution:

Add the following --chmod=u+rwx to your rsync command! (or manually set the permissions but in that case you never can be sure if it succeeds or not)

2
  • Any chance the destination filesystem is remote mounted? I had a similar (but different) issue with an NTFS filesystem mounted on a Linux box. The default mount had all write permissions denied. Jan 4, 2014 at 17:56
  • No, it is a Linux RAID ext3 partition on a USB hard drive.
    – Matthijs
    Jan 5, 2014 at 8:05

1 Answer 1

0

I guess this is a rights issue, not having the proper rights on the linux system. On the PI, go to the foto folder and execute the following command:

ls -al

This should display the owner and group of the folders, and who has write rights.

If you won't mind deleting the folders that don't sync, delete them, rsync again and see if they are recreated. If this happens, they should have the proper rights. Compare it to the previous output. If not, give us the output of the ls command.

10
  • Hi, I've updated the main question it seems you are right about this!
    – Matthijs
    Jan 5, 2014 at 8:04
  • Change the permissions manually. chmod 700 foldername should set them to the same permissions.
    – SPRBRN
    Jan 5, 2014 at 11:31
  • Create another folder on the windows machine, 2013x or something. See if that works properly. If not, copy the 2012 folder to 2012x, empty it and put a test file in it, and see if that works. If so, rename the 2013 folder to 2013backup, rename 2012x to 2013 and move all files into that new folder. I guess there is a small difference between those folders that you don't see.
    – SPRBRN
    Jan 5, 2014 at 12:04
  • 1
    And on some other site i found --chmod=u+rwx and that options works great! It seems to be working now (I will need to verify all files when the operation is complete)
    – Matthijs
    Jan 5, 2014 at 14:28
  • 1
    Yes that is possible, however by adding the --chmod=u+rwx option I know for sure that the right permissions are used! Without I would never be sure my backup will succeed. Thanks for your help by pointing me in the right direction!
    – Matthijs
    Jan 5, 2014 at 21:50

You must log in to answer this question.

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