rsync from remote to local
rsync -chavzP --stats [email protected]:/path/to/copy /path/to/local/storage
rsync from remote to local
rsync -chavzP --stats [email protected]:/path/to/copy /path/to/local/storage
rsync examples
The rsync command stands for Remote Synchronization.
The Linux command rsync is used to do a backup operation and fast copy file into the local system or remote system in UNIX/Linux.
rsync command examples
# rsync options source destination
$ rsync – zvr /var/www/website/ /root/tmp
$ rsync –avz /root/temp/ [email protected]:/home/linuxconcept/temp/
$ rsync –avz [email protected]:/var/lib/mysql /root/temp
rsync
# It is a Lunux/UNIX tool to copy files to and from remote,
# and between local directories.
# This tool is more efficient and versatile than SCP.
rsync [options (it has a lot)] [source] [destination]
# To push
rsync [options] /tmp/myfile.txt [email protected]:/home
# To pull
rsync [options] [email protected]:/home/myfile.txt /tmp/
Handy options:
--compress --recursive --verbose
rsync
#from hpc to local
rsync -chavzP --stats [email protected]:/path/to/copy /path/to/local/storage
#local to hpc
rsync -chavzP --stats /path/to/local/storage [email protected]:/path/to/copy
rsync examples
we use rsync to perform the backup process in Linux/UNIX.
$ rsync –zvr /home/linuxconcept/newweb/ /var/www/linuxconcept/
$ ls –l /home/linuxconcept/newweb/index.html /var/www/linuxconcept/index.html
$ rsync –zva /home/linuxconcept/newweb/ /var/www/linuxconcept/
$ rsync –v /etc/ssl/linuxconcept/pubkeys /home/linuxconcept/pubkeys
$ rsync -avz /root/temp/ [email protected]:/home/linuxconcept/temp/
$ rsync -avz [email protected]:/home/linuxconcept/satish /root/temp
$ rsync -avz -e ssh [email protected]:/home/linuxconcept/satish /root/temp
$ rsync -avzhe ssh –progress /home/linuxconcept [email protected]:/root/rpmpkgs
$ rsync –avz – -delete [email protected]:/home/linuxconcept/ .
$ rsync –avzhe ssh – -max-size=’400k’ /home/linuxconcept/satish/ [email protected]:/home/linuxconcept/tmp
rsync
rsync -a -m --include='*.txt' --include='*/' --exclude='*' source_dir/ destination_dir/
#this will copy with folder structure.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us