Rsync sin copiar directorios montados remotamente

2007-09-21 Por tema Iñaki Baz Castillo
Hola, tengo varias máquinas sincronizadas con Rsync, pero en una de ellas 
existen varios puntos de montaje de particiones remotas vía NFS.

La idea es que yo quiero sincronizar:

  /home
  /root

pero dentro de /home existe por ejemplo una carpeta que es un punto de montaje 
NFS:

  /home/nfs_mount

y yo quiero que esa carpeta no se copie, o sea, que se copie simplemente como 
carpeta pero no su contenido (que no está realmente en la máquina origen, 
claro).

Ya sé que una opción es definir que no copie dicho directorio pero en realidad 
son bastantes y prefiero una opción genérica:

Leyendo el man de Rsync veo que hay una opción:

---
-x, --one-file-system
 This tells rsync to avoid crossing a filesystem boundary when recursing. This 
does not limit the user's ability to specify items to copy from multiple 
filesystems, just rsync's recursion through the hierarchy of each directory 
that the user specified, and also the analogous recursion on the receiving 
side during deletion. Also keep in mind that rsync treats a “bind” mount to 
the same device as being on the same filesystem. 

If this option is repeated, rsync omits all mount-point directories from the 
copy. Otherwise, it includes an empty directory at each mount-point it 
encounters (using the attributes of the mounted directory because those of 
the underlying mount-point directory are inaccessible).
---

Parece lo que quiero, es decir, copiaría /home pero como recursivamente 
encuentra /home/nfs_mount que es un punto de montaje lo omitiría (otra cosa 
es que yo indique específicamente que copie /home/nfs_mount, ¿es así?).

No entiendo muy bien lo de If this option is repeated, rsync omits all 
mount-point directories from the copy, ¿significa que si pongo -x -x no me 
copia NINGUN punto de montaje ni siquiera aunque lo especifique en 
el --include?


Bueno, lo voy a probar y tal, pero agradecería alguna confirmación ya que es 
un equipo en producción y bueno... XD

Gracias.





-- 
Iñaki Baz Castillo



Re: Rsync sin copiar directorios montados remotamente [SOLUCIONADO]

2007-09-21 Por tema Iñaki Baz Castillo
El Viernes, 21 de Septiembre de 2007, Iñaki Baz Castillo escribió:

 ---
 -x, --one-file-system
  This tells rsync to avoid crossing a filesystem boundary when recursing.
 This does not limit the user's ability to specify items to copy from
 multiple filesystems, just rsync's recursion through the hierarchy of each
 directory that the user specified, and also the analogous recursion on the
 receiving side during deletion. Also keep in mind that rsync treats a
 “bind” mount to the same device as being on the same filesystem.

 If this option is repeated, rsync omits all mount-point directories from
 the copy. Otherwise, it includes an empty directory at each mount-point it
 encounters (using the attributes of the mounted directory because those of
 the underlying mount-point directory are inaccessible).
 ---

 Parece lo que quiero, es decir, copiaría /home pero como recursivamente
 encuentra /home/nfs_mount que es un punto de montaje lo omitiría (otra cosa
 es que yo indique específicamente que copie /home/nfs_mount, ¿es así?).

He hecho alguna prueba montándome unos directorios NFS y tal y parece que 
funciona. Es decir, si le dices que copie /home y /home contiene una 
subcarpeta que es un punto de montaje remoto su contenido no se copia (sólo 
la carpeta).




-- 
Iñaki Baz Castillo



Re: Rsync sin copiar directorios montados remotamente

2007-09-21 Por tema Blu
On Fri, Sep 21, 2007 at 11:21:43AM +0200, Iñaki Baz Castillo wrote:
[...]
 ---
 -x, --one-file-system
  This tells rsync to avoid crossing a filesystem boundary when recursing. 
 This 
 does not limit the user's ability to specify items to copy from multiple 
 filesystems, just rsync's recursion through the hierarchy of each directory 
 that the user specified, and also the analogous recursion on the receiving 
 side during deletion. Also keep in mind that rsync treats a “bind” mount to 
 the same device as being on the same filesystem. 
 
 If this option is repeated, rsync omits all mount-point directories from the 
 copy. Otherwise, it includes an empty directory at each mount-point it 
 encounters (using the attributes of the mounted directory because those of 
 the underlying mount-point directory are inaccessible).
 ---
 
 Parece lo que quiero, es decir, copiaría /home pero como recursivamente 
 encuentra /home/nfs_mount que es un punto de montaje lo omitiría (otra cosa 
 es que yo indique específicamente que copie /home/nfs_mount, ¿es así?).
 
 No entiendo muy bien lo de If this option is repeated, rsync omits all 
 mount-point directories from the copy, ¿significa que si pongo -x -x no me 
 copia NINGUN punto de montaje ni siquiera aunque lo especifique en 
 el --include?

No sé lo que pasará con un --include, pero lo que dice ahí es que -x copia
los puntos de montaje como directorios vacíos, mientras que -x -x
simplemente omite los puntos de montaje.

-- 
Blu,


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Rsync sin copiar directorios montados remotamente [SOLUCIONADO]

2007-09-21 Por tema Rhonny Lanz
Buenos dias

2007/9/21, Iñaki Baz Castillo [EMAIL PROTECTED]:

 El Viernes, 21 de Septiembre de 2007, Iñaki Baz Castillo escribió:

 
 ---
  -x, --one-file-system
   This tells rsync to avoid crossing a filesystem boundary when
 recursing.
  This does not limit the user's ability to specify items to copy from
  multiple filesystems, just rsync's recursion through the hierarchy of
 each
  directory that the user specified, and also the analogous recursion on
 the
  receiving side during deletion. Also keep in mind that rsync treats a
  bind mount to the same device as being on the same filesystem.
 
  If this option is repeated, rsync omits all mount-point directories from
  the copy. Otherwise, it includes an empty directory at each mount-point
 it
  encounters (using the attributes of the mounted directory because those
 of
  the underlying mount-point directory are inaccessible).
 
 ---
 
  Parece lo que quiero, es decir, copiaría /home pero como recursivamente
  encuentra /home/nfs_mount que es un punto de montaje lo omitiría (otra
 cosa
  es que yo indique específicamente que copie /home/nfs_mount, ¿es así?).

 He hecho alguna prueba montándome unos directorios NFS y tal y parece que
 funciona. Es decir, si le dices que copie /home y /home contiene una
 subcarpeta que es un punto de montaje remoto su contenido no se copia
 (sólo
 la carpeta).



Solo por recomendacion, no es bueno exportar /home. En estos dias me paso
que exporte un directorio /home/user usando nfs, lo que ocurrio a
continuacion, es que los archivos de profile de cada usuario/home cambiaron
por lo que el usuario no podia hacer login (por lo menos en la sesion
grafica) archivos como .bashrc y/o .bash_profile adquieren los permisos del
cliente nfs y el ambiente por supuesto que cambia al hacer login desde el
promt. Esto creo que tambien paso porque en el archivo /etc/exports, coloque
los permisos (rw)

De todas maneras, si se pensa hacer un export de /home/user, hay que ver
bien los uid y gid de los directorios $HOME en cuestion, deben ser los
mismos tanto en el nfs-server como en el nfs-cliente

Saludos

-- 
Rhonny Lanz R.
Linux Counter 377315
Debian Lenny User
Cel 0412-5019537
:~$ /Caracas_ Venezuela/
Blog -- http://lanzr.blogspot.com/


Re: Rsync sin copiar directorios montados remotamente

2007-09-21 Por tema Iñaki Baz Castillo
El Viernes, 21 de Septiembre de 2007, Blu escribió:
 On Fri, Sep 21, 2007 at 11:21:43AM +0200, Iñaki Baz Castillo wrote:
 [...]

  -
 -- -x, --one-file-system
   This tells rsync to avoid crossing a filesystem boundary when recursing.
  This does not limit the user's ability to specify items to copy from
  multiple filesystems, just rsync's recursion through the hierarchy of
  each directory that the user specified, and also the analogous recursion
  on the receiving side during deletion. Also keep in mind that rsync
  treats a “bind” mount to the same device as being on the same filesystem.
 
  If this option is repeated, rsync omits all mount-point directories from
  the copy. Otherwise, it includes an empty directory at each mount-point
  it encounters (using the attributes of the mounted directory because
  those of the underlying mount-point directory are inaccessible).
  -
 --
 
  Parece lo que quiero, es decir, copiaría /home pero como recursivamente
  encuentra /home/nfs_mount que es un punto de montaje lo omitiría (otra
  cosa es que yo indique específicamente que copie /home/nfs_mount, ¿es
  así?).
 
  No entiendo muy bien lo de If this option is repeated, rsync omits all
  mount-point directories from the copy, ¿significa que si pongo -x -x
  no me copia NINGUN punto de montaje ni siquiera aunque lo especifique en
  el --include?

 No sé lo que pasará con un --include, pero lo que dice ahí es que -x copia
 los puntos de montaje como directorios vacíos, mientras que -x -x
 simplemente omite los puntos de montaje.

Sí, sí, al final es lo mismo.

Gracias.



-- 
Iñaki Baz Castillo