rsync -av source destination
We can use user@host as part of the source or destination depending on whether we want to push or pull.To sync' files from a remote server to local (pull), we can do the below;
rsync -av username@host:path_to_source_folder path_to_local_folder
The below example will sync' the contents of source_www on the remote system to the local system, creating a new folder source_www
rsync -av plisken@192.168.8.5:/home/plisken/source_www /home/plisken/
Another example, preserving group and owner information is as below and should be run on the LOCAL(DESTINATION) machine. With the below example root@23.128.29.24:/var/www/fec being the REMOTE(SOURCE) machine and /var/STORAGE/BACKUPS/FEC being the LOCAL(DESTINATION) machine.
This will copy /var/www/fec and its contents from the REMOTE(SOURCE) to /var/STORAGE/BACKUPS/FEC/fec on the LOCAL(DESTINATION) machine.
Firstly you will need the sudo password for the current user running on the LOCAL(DESTINATION) machine, followed by the root password for the REMOTE(SOURCE) machine.
sudo rsync -avogz root@23.128.29.24:/var/www/fec /var/STORAGE/BACKUPS/FEC
the below is an example of pushing a local dir1 to a remote location;
rsync -av dir1 plisken@dl-sl-2:home/plisken/
See also here
No comments:
Post a Comment
Note: only a member of this blog may post a comment.