LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-01-2013, 02:07 PM   #1
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Rep: Reputation: 16
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?

Last edited by mahmoodn; 03-01-2013 at 02:09 PM.
 
Old 03-01-2013, 02:17 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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?
 
Old 03-01-2013, 02:30 PM   #3
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Indeed the destination folder is empty
 
Old 03-01-2013, 02:38 PM   #4
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
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!
 
Old 03-01-2013, 03:15 PM   #5
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.

Last edited by Kustom42; 03-02-2013 at 01:48 PM.
 
Old 03-02-2013, 12:24 AM   #6
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
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
 
Old 03-02-2013, 01:48 PM   #7
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we use exclude option in"rm" command to exclude some files/folders? yadav_rk727 Linux - Newbie 1 02-03-2010 10:14 AM
rsync not deleting folders on remote machine alexandersv Linux - Software 2 09-03-2008 10:15 AM
file transfer from remote window machine perky.nishi Linux - Newbie 1 06-24-2008 06:29 AM
Mount remote folders into local Ubuntu machine (sshfs) nthillaiarasu Ubuntu 1 01-06-2008 03:12 AM
closing SSH session without killing the SFTP transfer on the remote machine stevec Linux - Software 2 04-20-2006 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration