Comando RSYNC
rsync command common options
--delete : delete files that don't exist on sender (system)
-v : Verbose (try -vv for more detailed information)
-e "ssh options" : specify the ssh as remote shell
-a : archive mode
-r : recurse into directories
-z : compress file data
Sincronizar de equipo local a equipo remoto:
root@host # rsync -avz /path_origen_datos user@ip_host_destino_datos:/path_destino_datos
Sincronizar de equipo remoto a equipo local:
root@host # rsync -avz user@ip_host_origen_datos:/path_origen_datos /path_destino_datos
Sincronizar paths:
root@host # rsync -avz /path_origen /path_destino
Aclaracion....
path_origen: path_de_lo_que_quiero_mantener_en_el_nuevo_path_de_destino
path_destino: path_donde_quiero_dejar_el_origen
--------------------------------------------------------------------------------------------------------------------------------------
Ejemplo!!!!
admin@host$ ls -l /tmp/pau
total 0
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
admin@host $ ls -l /tmp/paulaa
total 16
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
admin@host$ rsync -avz /tmp/pau /tmp/paulaa
sending incremental file list
pau/
pau/filee
sent 104 bytes received 35 bytes 278.00 bytes/sec
total size is 0 speedup is 0.00
SE MANTUVO COMO ESTABA /tmp/pau
admin@host$ ls -l /tmp/pau
total 0
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
admin@host$ ls -l /tmp/paulaa
total 32
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
drwxr-xr-x 2 admin users 179 Jul 26 15:07 pau
COMO SE COPIO EL DIRECTORIO, MUESTRO COMO COPIAR EL CONTENIDO
admin@host$ rsync -avz /tmp/pau/* /tmp/paulaa
sending incremental file list
filee
sent 79 bytes received 31 bytes 220.00 bytes/sec
total size is 0 speedup is 0.00
admin@host$ ls -l /tmp/paulaa
total 32
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
drwxr-xr-x 2 admin users 179 Jul 26 15:07 pau
admin@host$
Otros comandos utiles...
Peso de file o directorio
root@host # du -hs path_file
Espacio libre usado porcentaje de file system
root@host # df -h path_file
rsync command common options
--delete : delete files that don't exist on sender (system)
-v : Verbose (try -vv for more detailed information)
-e "ssh options" : specify the ssh as remote shell
-a : archive mode
-r : recurse into directories
-z : compress file data
Sincronizar de equipo local a equipo remoto:
root@host # rsync -avz /path_origen_datos user@ip_host_destino_datos:/path_destino_datos
Sincronizar de equipo remoto a equipo local:
root@host # rsync -avz user@ip_host_origen_datos:/path_origen_datos /path_destino_datos
Sincronizar paths:
root@host # rsync -avz /path_origen /path_destino
Aclaracion....
path_origen: path_de_lo_que_quiero_mantener_en_el_nuevo_path_de_destino
path_destino: path_donde_quiero_dejar_el_origen
--------------------------------------------------------------------------------------------------------------------------------------
Ejemplo!!!!
admin@host$ ls -l /tmp/pau
total 0
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
admin@host $ ls -l /tmp/paulaa
total 16
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
admin@host$ rsync -avz /tmp/pau /tmp/paulaa
sending incremental file list
pau/
pau/filee
sent 104 bytes received 35 bytes 278.00 bytes/sec
total size is 0 speedup is 0.00
SE MANTUVO COMO ESTABA /tmp/pau
admin@host$ ls -l /tmp/pau
total 0
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
admin@host$ ls -l /tmp/paulaa
total 32
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
drwxr-xr-x 2 admin users 179 Jul 26 15:07 pau
COMO SE COPIO EL DIRECTORIO, MUESTRO COMO COPIAR EL CONTENIDO
admin@host$ rsync -avz /tmp/pau/* /tmp/paulaa
sending incremental file list
filee
sent 79 bytes received 31 bytes 220.00 bytes/sec
total size is 0 speedup is 0.00
admin@host$ ls -l /tmp/paulaa
total 32
drwxr-xr-x 2 admin users 117 Jul 26 15:06 dir1
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file2
-rw-r--r-- 1 admin users 0 Jul 26 15:06 file3
-rw-r--r-- 1 admin users 0 Jul 26 15:07 filee
drwxr-xr-x 2 admin users 179 Jul 26 15:07 pau
admin@host$
Otros comandos utiles...
Peso de file o directorio
root@host # du -hs path_file
Espacio libre usado porcentaje de file system
root@host # df -h path_file