5:35 PM RSYNC : A command in linux to copy files remotely. Faster and more flexible than rcp | |||||
The command is same like rcp but can be used for large and faster file transfer from one machine to another.
FORMAT: rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST rsync [OPTION]... SRC rsync [OPTION]... [USER@]HOST:SRC [DEST] rsync [OPTION]... [USER@]HOST::SRC [DEST] rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST] DESCRIPTION Some of the additional features of rsync are:
Perhaps the best way to explain the syntax is with some examples:
This will transfer all files matching the pattern *.c from the current directory to the directory src on the machine server1. If any of the files already exist on the remote system then the rsync remote-update protocol is used to update the file by sending only the differences. See the tech report for details. Note: rsync remote-update protocol does a checksum of fileslices against a local copy to reduce the traffic. -t: preserve modification time of file
This would recursively transfer all files from the directory src/bar on the machine foo into the /data/tmp/ directory on the local machine. The files are transferred in "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer. Additionally, compression will be used to reduce the size of data portions of the transfer. -a: --archive archive mode -v: --verbose verbose mode, increase verbosity. -z: --compress compress file data during the transfer -u: --update skip files that are newer on the receiver than on the sender side. -n, --dry-run perform a trial run with no changes made, only used to perform a trial. Note:- If you run this command using "-n" option, it wont make any changes. It will just perform a trial run. So, next time run the same command without "-n" option.
A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:
| |||||
|
Related blogs
You may also like to see:
[2015-01-18] | [Open System-Linux] |
The JAR archiving tool in Linux |
[2014-11-19] | [Open System-Linux] |
ETHTOOL : A tool in Linux to display or change ethernet card setting |
[2014-12-28] | [Open System-Linux] |
Shift command with examples |
[2016-05-24] | [Open System-Linux] |
FACTER command in Linux : showing system facts |
[2014-02-19] | [Open System-Linux] |
Shift Key is not working!! Mapping keyboard keys from one to another |
Total comments: 0 | |