Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (1) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (30) javascript (3) Linux (164) Mac (19) Machine Learning (1) mySQL (47) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (45) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Monday 6 June 2022

Rsync

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.