Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Help on a script...



Thanks Kalin...

But still verbose on creating dirs...
Maybe I could use use your options and redirecting the output. In fact I tried already,
a couple of months ago, and dirs copy was still verbose...

What happens in output when you want to copy the actual files, over the new tree?

Thanks again,
 
Bruno.

On Sun, Jun 3, 2012 at 10:39 AM, Kalin KOZHUHAROV <me.kalin@example.com> wrote:
On Sun, Jun 3, 2012 at 4:30 PM, Bruno Raoult <braoult@example.com> wrote:
> Hi all! And happy Mother's day if it the same than in France...
>
> I have a question for you: Do you know how to copy (rsync via ssh) a tree
> only, no files? I just want to avoid long log file, with directories...
>
Is this what you need:
$ cd /tmp
$ mkdir -p d1/D{2,3,4,5,6} d1/G{3,4}/F5
$ touch d1/D{2,3,4,5,6}/some_file d1/G{3,4}/F5/other d1/
$ touch d1/D{2,3,4,5,6}/some_file d1/G{3,4}/F5/other d1/D{2,3,4,5,6}/evenMORE
$ LC_ALL=C tree d1/
d1/
|-- D2
|   |-- evenMORE
|   `-- some_file
|-- D3
|   |-- evenMORE
|   `-- some_file
|-- D4
|   |-- evenMORE
|   `-- some_file
|-- D5
|   |-- evenMORE
|   `-- some_file
|-- D6
|   |-- evenMORE
|   `-- some_file
|-- G3
|   `-- F5
|       `-- other
`-- G4
   `-- F5
       `-- other
$ rsync-HavPS /tmp/d1/ /tmp/d2/ --include=*/ --exclude=*
sending incremental file list
created directory /tmp/d2
./
D2/
D3/
D4/
D5/
D6/
G3/
G3/F5/
G4/
G4/F5/

sent 187 bytes  received 51 bytes  476.00 bytes/sec
total size is 0  speedup is 0.00
$ LC_ALL=C tree d2
d2
|-- D2
|-- D3
|-- D4
|-- D5
|-- D6
|-- G3
|   `-- F5
`-- G4
   `-- F5

NB: order of include/exclude is important.
NB2: "-HavPS" may not be the best of options, I used it every time and
don't bother remembering what it means; works here

Cheers,
Kalin.

--
To unsubscribe from this mailing list,
please see the instructions at http://lists.tlug.jp/list.html

The TLUG mailing list is hosted by ASAHI Net, provider of mobile and
fixed broadband Internet services to individuals and corporations.
Visit ASAHI Net's English-language Web page: http://asahi-net.jp/en/



--
2 + 2 = 5, for very large values of 2.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links