Example code to rsync
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY jijimol.john
3 years ago
Remote-Sync
0
comments comment

rsync command is used to synchronize files and folder from source to destination. It may be same or different server. If the synchronization is in between different servers we have to use ssh credentials for connecting the two.

Example given below:


rsync -ravpzHogt --delete -e ssh {source-path} {sshuser_id}@{ip/site-address}:{destination-path}

Some of the options of rsync listed below.

r - rsync to copy directories recurssively.

a - archive - presave almost anything but does not presave the hardlinks. For that we use -H.

v - verbose, using this option we can see which files is transferring at that time.

p - permission, this option helps to update the permission of remote file is same as source file permission.

z - compress, this option helps to compress any data in files and sends it to destination.

H - Hardlink, recreate hard links on the remote system to be the same as the local system. If we doesnot use this option,
the hardlinks treated as normal files.

o -Using the option, to set the owner of the files to be same as source file.

g - group, rsync to set the group of destination file same as the source file.
This helps when the receiving program is not run by super user only groups have option to sent and recieving the data.

t - time, rsync the modification time along with files and folder and is updated on remote server.

--delete - This option helps to delete files from destination folder which is not present in source directory.

-e - command, This option allows to choose alternative remote shell program for rsync the files from source to destination server.

You can run this code as terminal command. Hope this article is useful.

Please get in touch with us to know more.


RELATED ARTICLE

more_horiz
close

on 12th August 2015 / by jijimol.john
rsync command is used to synchronize files and folder from source to destination. It may be same or different server. If the synchronization is in between different servers we have to use ssh credentials for connecting the two. Example given below: rsync -ravpzHogt --delete -e ssh {source-path} {sshuser_id}@{ip/site-address}:{destination-path} Some of the options of rsync listed below. r - rsync to copy directories recurssively. a - archive - presave almost anything but does not presave the hardlinks. For that we use -H. v - verbose, using this option we can see which files is transferring at that time. p - permission, this option helps to update the permission of remote file is same as source file permission. z - compress, this option helps to compress any data in files and sends it to destination. H - Hardlink, recreate hard links on the remote system to be the same as the local system. If we doesnot use this option, the hardlinks treated as normal files. o -Using the option, to set the owner of the files to be same as source file. g - group, rsync to set the group of destination file same as the source file. This helps when the receiving program is not run by super user only groups have option to sent and recieving the data. t - time, rsync the modification time along with files and folder and is updated on remote server. --delete - This option helps to delete files from destination folder which is not present in source directory. -e - command, This option allows to choose alternative remote shell program for rsync the files from source to destination server. You can run this code as terminal command. Hope this article is useful. Please get in touch with us to know more. Remote Sync Commands Leave a reply Your email address will not be published. Required fields are marker *
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.