Rsync user guide pdf




















The Add Group button opens the screen shown in Figure 4. Deduplication Deduplication is the process of ZFS transparently reusing a guids copy of duplicated data to save space.

If the key is ever lost or destroyed and there is no backup key, the data on the disks is inaccessible. It is slower than unen- crypted FTP due to the encryption overhead, but the data passing through the network is encrypted. If, however, the share will be used jser several users, instead type in a group name and check the Create Group box.

To remove a tunable, click its Delete button. Be cautious and careful when deleting ranges of snapshots. This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website.

We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience. Necessary cookies are absolutely essential for the website to function properly.

This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information. Skip to content. This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Privacy Overview This website uses cookies to improve your experience while you navigate through the website.

To use Rsync over SSH to transfer files remotely , append -e ssh to the rsync command. For example, to transfer sample. This command copied the DirM directory from To copy a specific file from a remote host, enter the full path of the source file and the destination on your local machine. For example:. To transfer multiple files or multiple directories from a remote server, list the paths using curly brackets after the IP address of the server. Separate the paths with a comma. When performing a large data backup , you may want to view the progress of the transfer.

Add the --progress flag to the rsync command to view the amount of data transferred, transfer speed, and the remaining time. This option tells rsync to delete any file or directory at the destination if the source does not have it. In some scenarios, you may want to delete the source files after the transfer. For example, you may be moving a weekly backup to a new server.

Once the transfer is done, you no longer need the source files on the old server. In that case, use the --remove-source-files flag to delete the source file you specified.

For example, this command transfers the backup file weekly. Rsync is a powerful synchronization tool. Since this tool allows you to copy and delete data, we advise you to do a dry run first to test if rsync does what you intended to.

The dry run option is especially useful when you want to delete files. To do a dry run, use the --dry-run option and follow regular rsync syntax. The output looks the same as when you are actually syncing files. However, this time data will not be synced. This option is useful, for example, when you want to skip small log or thumbnail files.

We also used the --progress option to demonstrate the usage of --bwlimit. You can use rsync to copy only a specific file type. This rsync command transfers all text files from the Documents directory to the rsync directory on your desktop. Rsync allows you to transfer only directory structure if you do not need the files at another location.

This option is useful when you want to keep track of when transfers took place without opening directory properties. If you keep in sync two directories, rsync does not copy a file if the same one exists at the destination. Sometimes it may happen that you modify a file at the destination and do not want to let rsync overwrite it. To avoid overwriting modified destination files, use the -u option. When you start transferring data, you can use the -i flag with rsync to check if there is a difference between the source and the destination.

This guide provided examples of 20 rsync comannds. For protocol 30 and beyond first supported in 3. For older protocols, the checksum used is MD4.

This is equivalent to -rlptgoD. It is a quick way of saying you want recursion and want to preserve almost everything with -H being a notable omission. The only exception to the above equivalence is when --files-from is specified, in which case -r is not implied. Note that -a does not preserve hardlinks, because finding multiply-linked files is expensive. You must separately specify -H. You may turn off one or more implied options by prefixing the option name with " no- ".

Not all options may be prefixed with a " no- ": only options that are implied by other options e. You may specify either the short or the long option name after the " no- " prefix e. The order of the options is important: if you specify --no-r -a , the -r option would end up being turned on, the opposite of -a --no-r. Note also that the side-effects of the --files-from option are NOT positional, as it affects the default state of several options and slightly changes the meaning of -a see the --files-from option for more details.

This tells rsync to copy directories recursively. See also --dirs -d. Beginning with rsync 3. This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer. It is also only possible when both ends of the transfer are at least version 3. Some options require rsync to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs , and --delay-updates.

Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3. See also the --delete-delay option that is a better choice than using --delete-after. Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias. Use relative paths. This indicates the full path names specified on the command line are sent to the server rather than only the last parts of the file names.

This is particularly useful when you want to send different directories at the same time. For example, if you used this command:. If instead you used.

These extra path elements are called "implied directories" i. If you want to duplicate a server-side symlink, include both the symlink via its path, and referent directory via its real path. It is also possible to limit the amount of path information that is sent as implied directories for each path you specify. With a modern rsync on the sending side beginning with 2. For older rsync versions, you would need to use a chdir to limit the source path.

For example, when pushing files:. This option affects the default behavior of the --relative option. When it is specified, the attributes of the implied directories from the source names are not included in the transfer.

This indicates the corresponding path elements on the destination system are left unchanged if they exist, and any missing implied directories are created with default attributes. This even allows these implied path elements to have big differences, such as being a symlink to a directory on the receiving side. Another way to accomplish this link preservation is to use the --keep-dirlinks option which also affects symlinks to directories in the rest of the transfer.

When pulling files from an rsync older than 3. With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what if any suffix gets appended using the --backup-dir and --suffix options. This prevents previously backed-up files from being deleted. In combination with the --backup option, this tells rsync to store all backups in the specified directory on the receiving side.

This can be used for incremental backups. You can additionally specify a backup suffix using the --suffix option otherwise the files backed up in the specified directory will keep their original file names. Note that if you specify a relative path, the backup directory will be relative to the destination directory, so you probably want to specify either an absolute path or a path that starts with ".. If an rsync daemon is the receiver, the backup dir cannot go outside the module's path hierarchy, so take extra care not to delete it or copy into it.

This option allows you to override the default backup suffix used with the --backup -b option. This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different. Note that this does not affect the copying of symlinks or other special files.

Also, a difference of file format between the sender and receiver is always considered to be important enough for an update, no matter what date is on the objects.

In other words, if the source has a directory where the destination has a file, the transfer would occur regardless of the timestamps. It only limits the files that the receiver requests to be transferred. This option changes how rsync transfers a file when its data needs to be updated: instead of the default method of creating a new copy of the file and moving it into place when it is complete, rsync instead writes the updated data directly to the destination file.

This option is useful for transferring large files with block-based changes or appended data, and also on systems that are disk bound, not network bound. It can also help keep a copy-on-write filesystem snapshot from diverging the entire contents of a file that only has minor changes. The option implies --partial since an interrupted transfer does not delete the file , but conflicts with --partial-dir and --delay-updates.

Before rsync 2. This causes rsync to update a file by appending data onto the end of the file, which presumes that the data that already exists on the receiving side is identical with the start of the file on the sending side. If a file needs to be transferred and its size on the receiver is the same or longer than the size on the sender, the file is skipped. This does not interfere with the updating of a file's non-content attributes e.

Implies --inplace , but does not conflict with --sparse since it is always extending a file's length. This works like the --append option, but the existing data on the receiving side is included in the full-file checksum verification step, which causes a file to be resent if the final verification step fails rsync uses a normal, non-appending --inplace transfer for the resend.

Note: before rsync 3. Tell the sending side to include any directories that are encountered. Unlike --recursive , a directory's contents are not copied unless the directory name specified is ". Without this option or the --recursive option, rsync will skip all directories it encounters and output a message to that effect for each one.

If you specify both --dirs and --recursive , --recursive takes precedence. Specify --no-dirs or --no-d if you want to turn this off. When symlinks are encountered, the item that they point to the referent is copied, rather than the symlink.

In older versions of rsync , this option also had the side-effect of telling the receiving side to follow symlinks, such as symlinks to directories. The only exception is when sending files to an rsync that is too old to understand -K -- in that case, the -L option still has the side-effect of -K on that older receiving rsync. This tells rsync to copy the referent of symbolic links that point outside the copied tree. Absolute symlinks are also treated like ordinary files, and so are any symlinks in the source path itself when --relative is used.

This option has no additional effect if --copy-links was also specified. This tells rsync to ignore any symbolic links which point outside the copied tree. All absolute symlinks are also ignored. Using this option in conjunction with --relative may give unexpected results. This option causes the sending side to treat a symlink to a directory as though it were a real directory.

Without this option, if the sending side has replaced a directory with a symlink to a directory, the receiving side deletes anything that is in the way of the new symlink, including a directory hierarchy as long as --force or --delete is in effect. If you want to follow only a few specified symlinks, a trick you can use is to pass them as additional source args with a trailing slash, using --relative to make the paths match up right.

For example:. This option causes the receiving side to treat a symlink to a directory as though it were a real directory, but only if it matches a real directory from the sender.

Without this option, the receiver's symlink would be deleted and replaced with a real directory. For example, suppose you transfer a directory " foo " containing a file " file ", but " foo " is a symlink to directory " bar " on the receiver.

Without --keep-dirlinks , the receiver deletes symlink " foo ", recreates it as a directory, and receives the file into the new directory. With --keep-dirlinks , the receiver keeps the symlink and " file " ends up in " bar ".

One note of caution: if you use --keep-dirlinks , you must trust all the symlinks in the copy. If it's possible for an untrusted user to create a symlink to any directory, the user could then on a subsequent copy replace the symlink with a real directory and affect the content of whatever directory the symlink references. For backup copies, you are better off using something like a bind mount instead of a symlink to modify your receiving hierarchy.

This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.

This option does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source. Cases in which the destination may end up with extra hard links include the following:.

Note that rsync can only detect hard links between files that are inside the transfer set. If rsync updates a file with extra hard-link connections to files outside the transfer, that linkage will be broken. If you are tempted to use the --inplace option to avoid this breakage, be very careful you know how your files are being updated so you are certain that no unintended changes happen due to lingering hard links and see the --inplace option for more caveats.

If incremental recursion is active see --recursive , rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy.

This does not affect the accuracy of the transfer i. One way to avoid this inefficiency is to disable incremental recursion using the --no-inc-recursive option. This option causes the receiving rsync to set the destination permissions to be the same as the source permissions. See also the --chmod option for a way to modify what rsync considers to be the source permissions.

Thus, when --perms and --executability are both disabled, rsync 's behavior is the same as that of other file-copy utilities, such as cp and tar.

In summary: to give destination files both old and new the source permissions, use --perms. The preservation of the destination's setgid bit on newly-created directories when --perms is off was added in rsync 2.

Older rsync versions erroneously preserved the three special permission bits for newly-created files when --perms was off, while overriding the destination's setgid bit setting on a newly-created directory.

Keep in mind that it is the version of the receiving rsync that affects these behaviors. This option causes rsync to preserve the executability or non-executability of regular files when --perms is not enabled.

When an existing destination file's executability differs from that of the corresponding source file, rsync modifies the destination file's permissions as follows:. The option also implies --perms. The source and destination systems must have compatible ACL entries for this option to work properly. See the --fake-super option for a way to backup and restore ACLs that are not compatible. This option causes rsync to update the destination extended attributes to be the same as the source ones.

For systems that support extended-attribute namespaces, a copy being done by a super-user copies all namespaces except system. A normal user only copies the user. To be able to backup and restore non-user namespaces as a normal user, see the --fake-super option. Note that this option does not copy rsync s special xattr values e. This "copy all xattrs" mode cannot be used with --fake-super. This option tells rsync to apply one or more comma-separated "chmod" modes to the permission of the files in the transfer.

The resulting value is treated as though it were the permissions that the sending side supplied for the file, which means that this option can seem to have no effect on existing files if --perms is not enabled. It is also legal to specify multiple --chmod options, as each additional option is only appended to the list of changes to make.

See the --perms and --executability options for how the resulting permission value can be applied to the files in the transfer. This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is running as the super-user see also the --super and --fake-super options. The preservation of ownership will associate matching names by default, but may fall back to using the ID number in some circumstances see also the --numeric-ids option for a full discussion.

This option causes rsync to set the group of the destination file to be the same as the source file. If the receiving program is not running as the super-user or if --no-super was specified , only groups that the invoking user on the receiving side is a member of will be preserved. Without this option, the group is set to the default group of the invoking user on the receiving side.

The preservation of group information will associate matching names by default, but may fall back to using the ID number in some circumstances see also the --numeric-ids option for a full discussion. This option causes rsync to transfer character and block device files to the remote system to recreate these devices. This option has no effect if the receiving rsync is not run as the super-user see also the --super and --fake-super options. This option causes rsync to transfer special files such as named sockets and fifos.

This tells rsync to transfer modification times with the files and update them on the remote system. This tells rsync to omit directories when it is preserving modification times see --times. If NFS is sharing the directories on the receiving side, it is a good idea to use -O. This option is inferred if you use --backup without --backup-dir. These activities include: preserving users via the --owner option, preserving all groups not only the current user's groups via the --groups option, and copying devices via the --devices option.

To turn off super-user activities, the super-user can use --no-super. This option also handles ACLs if --acls was specified and non-user extended attributes if --xattrs was specified. This is a good way to backup data without using a super-user, and to store ACLs from incompatible systems. The --fake-super option only affects the side where the option is used. To affect the remote side of a remote-shell connection, specify an rsync path:.

Since there is only one "side" in a local copy, this option affects both the sending and receiving of files. Try to handle sparse files efficiently so they take up less space on the destination.

Conflicts with --inplace because it's not possible to overwrite data in a sparse fashion. Other output should be mostly unchanged, but may differ in some areas. Notably, a dry run does not send the actual data for file transfers, so --progress has no effect, the "bytes sent", "bytes received", "literal data", and "matched data" statistics are too small, and the "speedup" value is equivalent to a run where no file transfers were needed.

With this option rsync 's delta-transfer algorithm is not used and the whole file is sent as-is instead. The transfer may be faster if this option is used when the bandwidth between the source and destination machines is higher than the bandwidth to disk especially when the "disk" is actually a networked filesystem. This is the default when both the source and destination are specified as local paths, but only if no batch -writing option is in effect.

This tells rsync to avoid crossing a filesystem boundary when recursing. This does not limit the user's ability to specify items to copy from multiple filesystems, only rsync 's recursion through the hierarchy of each directory that the user specified, and also the analogous recursion on the receiving side during deletion. Also, keep in mind that rsync treats a "bind" mount to the same device as being on the same filesystem.

If this option is repeated, rsync omits all mount-point directories from the copy. Otherwise, it includes an empty directory at each mount-point it encounters using the attributes of the mounted directory because those of the underlying mount-point directory are inaccessible. If rsync is told to collapse symlinks via --copy-links or --copy-unsafe-links , a symlink to a directory on another device is treated like a mount-point. Symlinks to non-directories are unaffected by this option.

This tells rsync to skip creating files including directories that do not exist yet on the destination. If this option is combined with the --ignore-existing option, no files will be updated which can be useful if all you want to do is delete extraneous files.

This tells rsync to skip updating files that already exist on the destination this does not ignore existing directories, or nothing would get done. See also --existing. This option can be useful for those doing backups using the --link-dest option when they need to continue a backup run that got interrupted.



0コメント

  • 1000 / 1000