Origen: http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
1- Copy/Sync Files and Directory Locally
This following command will sync a single file on a local machine from
one location to another location. Here in this example, a file name backup.tar needs to be copied or synced to /tmp/backups/ folder.
Copy Files
[root@tecmint]# rsync -zvh backup.tar /tmp/backups/
Copy Directory
[root@tecmint]# rsync -avzh /root/rpmpkgs /tmp/backups/
2- Copy/Sync Files and Directory to or From a Server
This command will sync a directory from a local machine to a remote machine. For example: There is a folder in your local computer “rpmpkgs” which contains some RPM packages and you want that local directory’s content send to a remote server, you can use following command.
Copy a Directory from Local Server to a Remote Server
[root@tecmint]$ rsync -avz rpmpkgs/ root@192.168.0.101:/home/
Copy/Sync a Remote Directory to a Local Machine
[root@tecmint]# rsync -avzh root@192.168.0.100:/home/tarunika/rpmpkgs /tmp/myrpms
No hay comentarios:
Publicar un comentario