LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   using rsunc to exclude some folders and transfer to remote machine (http://www.linuxquestions.org/questions/linux-general-1/using-rsunc-to-exclude-some-folders-and-transfer-to-remote-machine-4175452298/)

mahmoodn 03-01-2013 02:07 PM

using rsunc to exclude some folders and transfer to remote machine
 
I have a folder structure like this
Code:

base/ph_000/fl_00/
base/ph_000/fl_01/
base/ph_000/sim
base/ph_001/fl_00/
base/ph_001/fl_01/
base/ph_001/sim
base/ph_002/fl_00/
base/ph_002/fl_01/
base/ph_002/sim
....

I want to copy base/ph_*/sim to a remote machine. It seems that rsync can do the job. I am using this command

Code:

rsync avzP --exclude base/ph*/fl* base/ mahmood@191.235.19.14:/data/32cpu
But I get this messages:

Code:

....
skipping directory fl_01
skipping directory fl_02
skipping directory .
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

How can I fix that?

Kustom42 03-01-2013 02:17 PM

It doesnt look like thats an error, its a warning telling you it skipped some but thats based upon your exclude. Did it actually miss any of the files when transferring?

mahmoodn 03-01-2013 02:30 PM

Indeed the destination folder is empty

mahmoodn 03-01-2013 02:38 PM

OK. That problem has been solved by fixing "-avzP" and not "avzP" alone.

However, now I see this output:
Code:

sending incremental file list
./
fl_01/
fl_01/conf/
fl_01/conf/32kl1i/
fl_01/conf/32kl1i/configuration.out
      10313 100%    0.00kB/s    0:00:00 (xfer#1, to-check=1026/1914)

!!!!
As you can see it is sending the folder that *must* be excluded!

Kustom42 03-01-2013 03:15 PM

Encapsulate your exclude pattern in single quotes.

Code:

rsync -avzP --exclude 'base/ph*/fl*' /base mahmood@191.235.19.14:/data/32cpu
Also, separate your exclude patterns individually. You could have as many --exclude 'pattern' as you need.

mahmoodn 03-02-2013 12:24 AM

Why did you put "base" in exclusion?
I want to see this structure in the destination

base/ph_000/sim
base/ph_001/sim
base/ph_002/sim
....

The result of your command is
Code:

receiving incremental file list
drwxrwxr-x        4096 2013/03/02 07:15:14 32cpu

sent 52 bytes  received 62 bytes  1.51 bytes/sec
total size is 0  speedup is 0.00

which is incorrect

Kustom42 03-02-2013 01:48 PM

I read your command wrong and thought you were passing mutliple folders to the exclude. It was late, I edited the command and removed the additional exclude option.


All times are GMT -5. The time now is 09:18 AM.