Re: [solved] Re: rsync issue

2010-09-19 Thread Rodolfo Medina
Rodolfo Medina rodolfo.med...@gmail.com writes:

 In rsync manual I coudn't find a solution to what I want.  I wish to copy
 all my home directory into another machine with the --delete option, but:

 1) I dont't want hidden files, i.e.: `.*' to be copied;

 2) on the other hand, there are some symlinks, beginning with `.', that I
want to be copied.

 The --exclude option won't help.

 From my home directory, if I do:

  $ rsync -vrtul --delete * 192.168.0.2:/home/rodolfo

 , hidden files that are in `~/' are not copied at all nor the --delete
 option applies to files that are in `~/', so it's not good; from /home, if
 I do:

  $ rsync -vrtul --delete rodolfo 192.168.0.2:/home

 , everything is copied, also system hidden directories and files, which I
 don't want.


 I mean, I want hidden files to be copied, except than
 those in `~/': of those, i.e. of the hidden files in `~/', I just want the
 symlinks to be copied.


I think it's better to create the symlinks by hand, as they can be different
when going from a system to another.  Then the following is good for me:

 $ cd
 $ rsync -vrtul --delete --exclude='.*' . 192.168.0.2:/home/rodolfo

The main issue here is that I had to replace `*' with `.' as the list of files
to be transferred.

Thanks for anyone's help.
Rodolfo


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87pqwa16no@gmail.com



[solved] Re: rsync issue

2010-09-17 Thread Rodolfo Medina
Rodolfo Medina rodolfo.med...@gmail.com writes:

 In rsync manual I coudn't find a solution to what I want.  I wish to copy
 all my home directory into another machine with the --delete option, but:

 1) I dont't want hidden files, i.e.: `.*' to be copied;

 2) on the other hand, there are some symlinks, beginning with `.', that I
want to be copied.

 The --exclude option won't help.

 From my home directory, if I do:

  $ rsync -vrtul --delete * 192.168.0.2:/home/rodolfo

 , hidden files that are in `~/' are not copied at all nor the --delete
 option applies to files that are in `~/', so it's not good; from /home, if I
 do:

  $ rsync -vrtul --delete rodolfo 192.168.0.2:/home

 , everything is copied, also system hidden directories and files, which I
 don't want.


 I mean, I want hidden files to be copied, except than
 those in `~/': of those, i.e. of the hidden files in `~/', I just want the
 symlinks to be copied.


Thanks to Rob and Karl for their help.  The following seems to work:

 $ rsync -vrtul --delete --exclude='rodolfo/.*' rodolfo 192.168.0.2:/home

, and I'll create the symlinks by hand.  Maybe there's a better solution: I
wish the `delete' option worked also for files and not only for directories,
but in rsync manual couldn't find that.

Rodolfo


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87hbhoo6wx@gmail.com



Re: [solved] Re: rsync issue

2010-09-17 Thread Jesús M. Navarro
Hi, Rodolfo:

On Friday 17 September 2010 15:07:10 Rodolfo Medina wrote:
 Rodolfo Medina rodolfo.med...@gmail.com writes:
  In rsync manual I coudn't find a solution to what I want.  I wish to
  copy all my home directory into another machine with the --delete
  option, but:
 
  1) I dont't want hidden files, i.e.: `.*' to be copied;
 
  2) on the other hand, there are some symlinks, beginning with `.', that
  I want to be copied.

[...]

 Thanks to Rob and Karl for their help.  The following seems to work:

  $ rsync -vrtul --delete --exclude='rodolfo/.*' rodolfo 192.168.0.2:/home

 , and I'll create the symlinks by hand.  Maybe there's a better solution: I
 wish the `delete' option worked also for files and not only for
 directories, but in rsync manual couldn't find that.

Recheck.  --delete certainly works on files.  Your problem is you can't rely 
on object names in order to know what has to be copied or not, since the name 
of both the hidden files and the symlinks check against the same pattern.

Since you have a pattern problem, you may build a component list and then 
apply it as a filter (see the filters section from rsync's man page).

Since you want to copy everything but top level hidden files I'd try something 
like this two-step procedure (next command is a single line):

1) find /path/to/rodolfo -maxdepth 1 -type 
f -name '.*' -fprint /path/to/filterfile

Then within /path/to/filterfile there should be the list of hidden files you 
want to ignore.

2) After that, the rsync step should do the trick, kindof (next command is a 
single line) :
rsync -a --exclude-from=/path/to/filterfile /path/to/rodolfo/ 
remoteu...@remotehost:/path/to/rodolfo

I didn't test the above commands so there might be minor flaws you should 
check but I think you get the idea.

Cheers.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201009180503.54771.jesus.nava...@undominio.net