LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Rsync duplication files (https://www.linuxquestions.org/questions/linux-general-1/rsync-duplication-files-470382/)

TheBrick 08-03-2006 06:37 AM

Rsync duplication files
 
Hello all,

I have been trying to use rsync to keep files updated between two computers. I have tried this with mock file and all seems to work. however when I do it for real it just creats another file of the same name with in the file. My rsync code is

Code:

rsync -vra tommy@192.168.1.5:/home/tommy/fortran /home/tommy/fortran
I have also tried
Code:

rsync -vrU tommy@192.168.1.5:/home/tommy/fortran /home/tommy/fortran
As I understand it both of these should end up updating the files and folders within ~/fortran however what happens is I end up with all of my old files still with in ~/fortran and in ~/fortran/fortran/

e.g
Code:

~/fortran $ ls -l
total 6
drwxr-xr-x  4 tommy users 1648 Jul 10 09:53 ValidatedStrain
drwxr-xr-x  9 tommy users  256 Aug  3 10:23 fortran
######### My backeding up file has just created a new file all other files are old!###################
drwxr-xr-x  5 tommy users 1688 Jul 10 09:53 random_methods
drwxr-xr-x  2 tommy users 1368 Jul 10 09:54 repeatestrain
drwxr-xr-x  3 tommy users  104 Jul 10 09:54 safe_copy_of_stokesian
drwxr-xr-x  4 tommy users 1592 Jul 10 09:54 shear
drwxr-xr-x  4 tommy users  880 Jul 10 09:54 testing
drwxr-xr-x  2 tommy users  272 Jul 10 09:54 testout

I end up with new copies of all of the files. Please help as it is becoming very difficult keeping track of things. As with every question I ask this is probibly very simple but I am a very simple guy!

spirit receiver 08-03-2006 07:02 AM

This is an excerpt from "man rsync":
Quote:

rsync -avz foo:src/bar /data/tmp


This would recursively transfer all files from the directory src/bar on the machine foo into the /data/tmp/bar directory on the local machine. The files are transferred in "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer. Additionally, compression will be used to reduce the size of data portions of the transfer.


rsync -avz foo:src/bar/ /data/tmp


A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:


rsync -av /src/foo /dest
rsync -av /src/foo/ /dest/foo

TheBrick 08-03-2006 07:15 AM

Thanks very much. I had been googling buth every thing I tried ended up with the results I got.


All times are GMT -5. The time now is 02:19 AM.