3

Hi I have been using rsync successfully to backup files from my external drive to a cifs mounted shared drive since Ubuntu 10.04

Now with 13.04 I am getting a strage behavior with the following command

rsync -av /media/hari/MyExtDrive/  /home/MyDFSMountedCIFSDrive/DataBackup/

The "MyDFSMountedCIFSDrive" is mounted using options

sudo mount -t cifs //10.1.1.11/dfsroot/archive/ /home/MyDFSMountedCIFSDrive -o user=hari,rw,nosuid,gid=1000,uid=1000,hard

Now when I use the rsync command. The entire Directory structure is created . I have several files in sub-drectories with the "img" extension . The sub-directories are also created appropriately. But for the files in these subdirectories , I have a file that is zero bytes that starts with a "." and has a weird hex extension

Actual file

P_248509-A_060.img   36MB

Instead rsync creates (note the "." in the beginning)

.P_248509-A_060.img.CluiPK  0 bytes

Does anyone know what is going on

I can use "cp -R" and copy these files accurately. I have not seen rsync do this with my 10.04 systems. Any ideas?

5

So I got this to work , but I still dont know why it failed.

First the .P_248509-A_060.img.CluiPK file that is 0 bytes I learnt is a temporary file. rsync creates these temporary files that it then moves over to the final name.

I figured this out because on a 10.04 box , A similar rsync gave messages saying it could not rename .P_248509-A_060.img.CluiPK to P_248509-A_060.img

I also read this question here where the second answer indicated that the .XXXX files are temporary files

Finally once I knew these were temp files I googled and found this solution on superuser

So replacing my command with

rsync -av /media/hari/MyExtDrive/  /home/MyDFSMountedCIFSDrive/DataBackup/ -T /tmp

OR

rsync -av /media/hari/MyExtDrive/  /home/MyDFSMountedCIFSDrive/DataBackup/ --inplace

The files are copied over accurately and completely.

Now My question is , why did rsync not tell me that it was failing because of some issue with the tempfile. I was confused because it failed silently. I dont know what it is about the source disk or the cifs mounted destination drive that made it fail silently!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.