Client Command (hsync)
The hsync command is a command that synchronizes files between a remote server and clients. It also supports synchronizing local files.
#
Basic FormatThe basic format is as follows.
Local : hsync [OPTION]... SRC [SRC]... DEST
Remote : Push : hsync [OPTION]... SRC [SRC]... [USER@]HOST[:PORT]:DEST Pull : hsync [OPTION]... [USER@]HOST[:PORT]:SRC [:SRC]... DEST
#
Option ListThe options for the hsync commands are below.
Synchronization
Description | Short Name | Option Name |
---|---|---|
Verify transferred files by digest check | c | checksum |
Archive mode is -rlptgoD | a | archive |
Recurse into directories | r | recursive |
Use relative path names | R | relative |
Don’t send implied dirs with --relative | no-implied-dirs | |
Make backups | b | backup |
Make backups into hierarchy based in DIR | backup-dir | |
Backup suffix (default ~) | suffix | |
New files are updated | u | update |
Update destination files by in-place copy | inplace | |
Transfer directories without recursing | d | dirs |
Copy symlinks as symlinks | l | links |
Transform symlink into referent file/dir | L | copy-links |
Only “unsafe” symlinks are transformed | copy-unsafe-links | |
Ignore symlinks that point outside the tree | safe-links | |
Transform symlink to dir into referent dir | k | copy-dirlinks |
Treat symlinked dir on receiver as dir | K | keep-dirlinks |
Preserve permissions | p | perms |
Preserve executability | E | executability |
Affect file and/or directory permissions | chmod | |
Preserve owner | o | owner |
Preserve group | g | group |
Preserve device files | devices | |
Preserve special files | specials | |
Specify device fies and special files | D | |
Preserve modification times | t | times |
Omit directories from --times | O | omit-dir-times |
Omit symlinks from --times | J | omit-link-times |
Receiver attempts super-user activities | super | |
Perform a trial run with no changes made | n | dry-run |
Copy files whole | W | whole-file |
Skip creating new files on receiver | existing | |
Skip updating files that exist on receiver | ignore-existing | |
An alias for --delete-during | del | |
Delete extraneous files from dest dirs | delete | |
Receiver deletes before transfer, not during | delete-before | |
Receiver deletes during the transfer | delete-during | |
Find deletions during, delete after transfer | delete-delay | |
Receiver deletes after transfer, not during | delete-after | |
Delete excluded files from dest dirs | delete-excluded | |
Force deletion of dirs even if not empty | force | |
Don’t delete more than NUM files | max-delete | |
Don’t transfer any file larger than SIZE | max-size | |
Don’t transfer any file smaller than SIZE | min-size | |
Keep partially transferred files | partial | |
Put a partially transferred file into DIR | partial-dir | |
Prune empty directory chains from file-list | m | prune-empty-dirs |
Don’t map uid/gid values by user/group name | numeric-ids | |
Custom username mapping | usermap | |
Custom groupname mapping | groupmap | |
Simple username/groupname mapping | chown | |
Don’t skip files that match size and time | I | ignore-times |
Skip files that match in size | size-only | |
Set the accuracy for mod-time comparisons | @ | modify-window |
Create temporary files in directory DIR | T | temp-dir |
Compress file data during the transfer | z | compress |
Explicitly set compression level | compress-level | |
Add a file-filtering | f | filter |
Add a rule to exclude files | exclude | |
Read exclude patterns from a file | exclude-from | |
Add a rule to include files | include | |
Read include patterns from a file | include-from | |
Read a list of source-file names from a file | files-from | |
Give some file-transfer stats | stats | |
Output numbers in a human-readable format | h | human-readable |
Show progress during transfer | progress | |
Specify partial and progress settings | P | |
Output a change-summary for all updates | i | itemize-changes |
Output updates using the specified format | out-format | |
Stop rsync at the specified point in time | stop-at | |
Stop rsync after the specified time have elapsed | stop-after |
Selectable Communication Method Function
Description | Short Name | Option Name |
---|---|---|
The HpFP protocol | hpfp | |
The WebSocket protocol(SSL/TLS) | wss | |
The port-separation UDP(HpFP) protocol(deprecated) | udp | |
The WebSocket protocol (plaintext communications) | ws | |
Directly connect to the Proxy server when the WebSocket protocol | ws-proxy-direct | |
Set the Proxy server when the WebSocket protocol | ws-proxy | |
Multiple connections | mcd |
Congestion Control
Description | Short Name | Option Name |
---|---|---|
Congestion control modes in the HpFP protocol | hpfp-cong |
Data Flow Control, Message Data Size Control
Description | Short Name | Option Name |
---|---|---|
MSS(Maximum Segment Size) in the HpFP protocol | hpfp-mss |
Data Flow Control, Data Buffer Setting
Description | Short Name | Option Name |
---|---|---|
Set the sending buffer size for the HpFP protocol | hpfp-sndbuf | |
Set the receiving buffer size for the HpFP protocol | hpfp-rcvbuf |
Data Flow Control, Bandwidth Control
Description | Short Name | Option Name |
---|---|---|
Limit socket I/O bandwidth | bwlimit |
Authentication
Description | Short Name | Option Name |
---|---|---|
Server certificate checking is disabled in WebSocket protocol communications | wss-no-check-certificate | |
Specify a username first and synchronization | user | |
Specify a password first and synchronization | password |
Retransmission Function
Description | Short Name | Option Name |
---|---|---|
automatically rerun | auto-rerun |
Various Monitorings
Description | Short Name | Option Name |
---|---|---|
Investigation mode starts (deprecated) | investigation |
Log Management
Description | Short Name | Option Name |
---|---|---|
Increase log verbosity | v | verbose |
Set the log verbosity level of INFO | info | |
Suppress non-error messages | q | quiet |
Specify a file where to log progress | log-file | |
Specify an application log output destination | hcp-log-file | |
Specify various statistics log output destinations | hcp-stat-log-file | |
Specify an execution record output destination | hcp-out | |
Start in the multiple-run mode | multi-run |
Software Information Update
Description | Short Name | Option Name |
---|---|---|
Check the application version | V | version |
Check the configuration and input parameters | config-test | |
Display the command help | h | help |
System Operating Environment Settings
Description | Short Name | Option Name |
---|---|---|
Setting form a path of the configuration file | config-file | |
Make configuration from command line | config-option | |
Setting by a relative path from the current directory | include-conf-from-cwd | |
Server compatibility disabled | no-earlier-serv-compat |
Please refer to the hcpd command section on the following option.
--investigation
Please refer to the hcp command section on the following option.
--hpfp, --wss, --user, --password, --config-file, --config-option, --hcp-log-file, --hcp-stat-log-file, --udp, --ws, --wss-no-check-certificate, --ws-proxy-direct, --ws-proxy, --hpfp-cong, --hpfp-mss, --hpfp-sndbuf, --hpfp-rcvbuf, --hcp-out, --multi-run, --include-conf-from-cwd, --no-earlier-serv-compat, --mcd
--hcp-log-file and --hcp-stat-log-file are corresponding to --log-file and --stat-log-file of the hcp command respectively.
#
Synchronization#
c, checksum=========================================================================Supported OS : Linux / WindowsFormat : -c | --checksum=========================================================================
When a checksum doesn’t match, it behaves to transmit the file.
--Example:[user@localhost ~]$ hsync -c ...--
#
a, archive=========================================================================Supported OS : Linux / WindowsFormat : -a | --archive=========================================================================
It behaves the same as -rlptgoD. This option is effective to set a directory archive with maintaining the file attribute.
--Example:[user@localhost ~]$ hsync -a ...--
#
r, recursive=========================================================================Supported OS : Linux / WindowsFormat : -r | --reursive=========================================================================
It recursively searches directories and transmits files.
--Example:[user@localhost ~]$ hsync -r ...--
#
R, relative=========================================================================Supported OS : Linux / WindowsFormat : -R | --relative=========================================================================
Use relative paths.
--Example:[user@localhost ~]$ hsync -R ...--
#
no-implied-dirs=========================================================================Supported OS : Linux / WindowsFormat : --no-implied-dirs=========================================================================
When --relative is used, this suppresses sending information of intermediate directories of relative paths given from the command line arguments. It results in preventing hsync from removing symbolic links on a path corresponding to the intermediate directories on the receiver side due to collision of file types. --keep-dirlinks also works for this purpose.
--Example:[user@localhost ~]$ hsync --no-implied-dirs ...--
#
b, backup=========================================================================Supported OS : Linux / WindowsFormat : -b | --backup=========================================================================
In backup, if a file with the same name exists in the destination, the transferring file is renamed.
--Example:[user@localhost ~]$ hsync -b ...--
#
backup-dir=========================================================================Supported OS : Linux / WindowsFormat : --backup-dir=<dir-name>-------------------------------------------------------------------------dir-nameDefault : noneRange of Values : path component characters=========================================================================
A directory name to backup is specified.
--Example:[user@localhost ~]$ hsync --backup-dir=backup_20211013 ...--
#
suffix=========================================================================Supported OS : Linux / WindowsFormat : --suffix=<suffix-name>=========================================================================
The suffix to rename for backup is specified.
--Example:[user@localhost ~]$ hsync --suffix=.bk ...--
#
u, update=========================================================================Supported OS : Linux / WindowsFormat : -u | --update=========================================================================
It doesn’t transfer files that are newer on the destination. In the case of the same update time, when the file size is different, It will be transmitted.
--Example:[user@localhost ~]$ hsync -u ...--
#
inplace=========================================================================Supported OS : Linux / WindowsFormat : --inplace=========================================================================
It instructs the receiver to write files without temporary files. When transferring a file is aborted, the file is kept as a partial file. Resuming the file will be performed when a digest of the partial file is identical to one of the source file in range from the head to a length of the partial file.
--Example:[user@localhost ~]$ hsync --inplace ...--
#
d, dirs=========================================================================Supported OS : Linux / WindowsFormat : -d | --dirs=========================================================================
It instructs the source to include all directories that are encountered. Unlike --recursive, a directory’s contents are not copied, unless the tail end of the directory name is specified with “.” or “/”.
--Example:[user@localhost ~]$ find from_dir/from_dir/from_dir/dir01from_dir/dir02from_dir/dir02/file02.txtfrom_dir/dir03from_dir/dir03/dir03_1from_dir/dir03/dir03_1/file03_1.txtfrom_dir/dir03/dir03_1/file03_2.txtfrom_dir/file.txt[user@localhost ~]$ hsync --dirs ... from_dir/ to_dir/[user@localhost ~]$ find to_dir/to_dirto_dir/dir01to_dir/dir02to_dir/dir03to_dir/file.txt--
#
l, links=========================================================================Supported OS : LinuxFormat : -l | --links=========================================================================
The symbolic link from the source is copied directly to the destination.
If you do not specify any options related to link-copy, such as --links, --copy-links, etc., symbolic links are not copied to destinations.
--Example:[user@localhost ~]$ hsync -l ...--
#
L, copy-links=========================================================================Supported OS : LinuxFormat : -L | --copy-links=========================================================================
It transforms each symlink encountered in the source into the referent item following the symlink chain to the file or directory that it references.And then it copies it to the destination.
If you do not specify any options related to link-copy, such as --links, --copy-links, etc., symbolic links are not copied to destinations.
--Example:[user@localhost ~]$ hsync -L ...--
#
copy-unsafe-links=========================================================================Supported OS : LinuxFormat : --copy-unsafe-links=========================================================================
“unsafe” symbolic links are first resolved to the referent of symbolic and copied to the destination.
“unsafe” symbolic links are the followings.
- symbolic links pointing outside the copied tree.
- symbolic links pointing to absolute paths.
--Example:[user@localhost ~]$ hsync --copy-unsafe-links ...--
#
safe-links=========================================================================Supported OS : LinuxFormat : --safe-links=========================================================================
This command instructs not to copy “unsafe” symbolic links themselves to the destinations.
“unsafe” symlinks copies are skipped in --copy-links or --copy-unsafe-links unless any options specify the referents to copy.
--Example:[user@localhost ~]$ hsync --safe-links ...--
#
k, copy-dirlinks=========================================================================Supported OS : LinuxFormat : -k | --copy-dirlinks=========================================================================
hsync follows symbolic links at source refer to directories and copy the directories in names of the symbolic links to the destination. This option dose not resolve symbolic links to files.
--Example:[user@localhost ~]$ hsync --copy-dirlinks ...--
#
K, keep-dirlinks=========================================================================Supported OS : LinuxFormat : -K | --keep-dirlinks=========================================================================
hsync keeps symbolic links pointed to directories on the receiver side without deleting the links. And it transfer files recursively when -r option is specified as if the kept links are directories.
When this option is not set and a directory whose name is identical to the name of the link exists on the sender side, hsync determines they are conflicted resources and delete the link to replace by the directory. This option suppresses this behavior.
--Example:[user@localhost ~]$ hsync --keep-dirlinks ...--
#
p, perms=========================================================================Supported OS : LinuxFormat : -p | --perms=========================================================================
The source permissions are maintained at the destination when copying.
--Example:[user@localhost ~]$ hsync -p ...--
#
E, executability=========================================================================Supported OS : LinuxFormat : -E | --executability=========================================================================
Execute permissions in the destination are set by judging the file executability in the source.
When a file has an execution attribute of any of owner, group, or other, it is judged to be executable. In the case that the execution attribute is different between the source and destination, the file permission in the destination is modified as follows.
To make a file non-executable, all execution attribute ‘x’ is turned off.\
To make a file executable, the execution attribute ‘x’ of the field where a read attribute ‘r’ is set, is turned on.
Example: [user@localhost ~]$ hsync -E ...
#
chmod=========================================================================Supported OS : LinuxFormat : --chmod=<modifier>[,<modifier>...]-------------------------------------------------------------------------modifierDefault : noneRange of Values : permission modifiers (based on the chmod command)=========================================================================
This option applies the specified permission to the file.
Permission modifiers follow the format of the chmod command, whose extension format is below.
https://download.samba.org/pub/rsync/rsync.1--chmod=CHMOD
--Example:[user@localhost ~]$ hsync --chmod=Dg+s,ug+w,Fo-w,+X ...[user@localhost ~]$ hsync --chmod=D2775,F664 ...--
#
o, owner=========================================================================Supported OS : LinuxFormat : -o | --owner=========================================================================
This option maintains the owner of the source file when copying.
When --numeric-ids is not set, UID is set by resolving from the username of the owner attribute in the source files on the destination host. In the case of UID can’t be resolved, such as no user, etc., UID is set the same value as the source file.
--Example:[user@localhost ~]$ hsync -o ...--
#
g, group=========================================================================Supported OS : LinuxFormat : -g | --group=========================================================================
This option maintains the group of the source file when copying.
When --numeric-ids is not set, GID is set by resolving from the groupname in the group attribute on the source files on the destination host. If GID can’t be resolved, such as no group, etc., GID is set at the same value as the source file.
--Example:[user@localhost ~]$ hsync -g ...--
#
devices=========================================================================Supported OS : LinuxFormat : --devices=========================================================================
This tells hsync to copy device files. When this option is not set, device files will be skipped.
--Example:[user@localhost ~]$ hsync --devices ...--
#
specials=========================================================================Supported OS : LinuxFormat : --specials=========================================================================
This tells hsync to copy special files (FIFO and sockets). When this option is not set, special files will be skipped.
--Example:[user@localhost ~]$ hsync --specials ...--
#
D=========================================================================Supported OS : LinuxFormat : -D=========================================================================
This tells hsync to use --devices and --specials.
--Example:[user@localhost ~]$ hsync -D ...--
#
t, times=========================================================================Supported OS : Linux / WindowsFormat : -t | --times=========================================================================
This option maintains the modification time of the source file.
--Example:[user@localhost ~]$ hsync -t ...--
#
O, omit-dir-times=========================================================================Supported OS : Linux / WindowsFormat : -O | --omit-dir-times=========================================================================
This option doesn’t maintain the modification times of the directory when copying.
This option is effective only when both -r and --times options are enabled. This option is also applied to symbolic links to directories. The update time is not stored.
--Example:[user@localhost ~]$ hsync -rtO ...--
#
J, omit-link-times=========================================================================Supported OS : Linux / WindowsFormat : -J | --omit-link-times=========================================================================
This option doesn’t maintain the modification times of the symbolic link when copying.
This option is effective only when both --times and --links options are enabled.
--Example:[user@localhost ~]$ hsync -tlJ ...--
#
super=========================================================================Supported OS : LinuxFormat : --super=========================================================================
This tells hsync to perform some operations which requires privileges like the following operations. When this option is not set, hsync will determine to perform or not to subject to user’s access rights on the receiver side.
- Change owner of files
- Change group of files
- Copy device files
--no-super also tells hsync not to perform them regardless of user’s access rights.
--Example:[user@localhost ~]$ hsync --super ...--
#
n, dry-run=========================================================================Supported OS : Linux / WindowsFormat : -n | --dry-run=========================================================================
This option makes a trial copy without practically operating the file.
--Example:[user@localhost ~]$ hsync --dry-run ...--
#
W, whole-file=========================================================================Supported OS : Linux / WindowsFormat : -W | --whole-file=========================================================================
On resuming a file, this option tells hsync to copy the total of the file from the head, but not from a resuming position. This option is effective only when --inplace options are enabled.
--Example:[user@localhost ~]$ hsync -W --inplace...--
#
existing=========================================================================Supported OS : Linux / WindowsFormat : --existing=========================================================================
This option copies files existing on the destination but skips copying the files which do not exist yet on the destination.
--Example:[user@localhost ~]$ hsync --existing ...--
#
ignore-existing=========================================================================Supported OS : Linux / WindowsFormat : --ignore-existing=========================================================================
This option copies files which do not exist yet on the destination but skips updating the files existing on the destination.
--Example:[user@localhost ~]$ hsync --ignore-existing ...--
#
del=========================================================================Supported OS : Linux / WindowsFormat : --del=========================================================================
This option is an alias for --delete-during.
--Example:[user@localhost ~]$ hsync --del ...--
#
delete=========================================================================Supported OS : Linux / WindowsFormat : --delete=========================================================================
This option deletes files and directories in the destination that don’t exist in the source. The deletion range is confined to the synchronized directories.
--Example:[user@localhost ~]$ hsync --delete ...--
#
delete-before=========================================================================Supported OS : Linux / WindowsFormat : --delete-before=========================================================================
This option requests file deletions be executed before the transfer.
--Example:[user@localhost ~]$ hsync --delete-before ...--
#
delete-during=========================================================================Supported OS : Linux / WindowsFormat : --delete-during=========================================================================
This option requests file deletions be executed during the transfer.
This is the default --delete operation mode.
--Example:[user@localhost ~]$ hsync --delete-during ...--
#
delete-delay=========================================================================Supported OS : Linux / WindowsFormat : --delete-delay=========================================================================
This option requests file deletions be executed after the transfer, but determining its deletions on transfer.
--Example:[user@localhost ~]$ hsync --delete-delay ...--
#
delete-after=========================================================================Supported OS : Linux / WindowsFormat : --delete-after=========================================================================
This option requests file deletions be executed after the transfer.
--Example:[user@localhost ~]$ hsync --delete-after ...--
#
delete-excluded=========================================================================Supported OS : Linux / WindowsFormat : --delete-excluded=========================================================================
This option tells hsync to remove files which are excluded from transfer.
--Example:[user@localhost ~]$ hsync --delete-excluded ...--
#
force=========================================================================Supported OS : Linux / WindowsFormat : --force=========================================================================
This option requests to delete non-empty directories.
This option is used to delete a directory, even though it is not empty, in the case that the source is a file or symbolic link and the destination directory is supposed to be deleted or overwritten.If this option is not set in the above condition, the destination directory is not deleted, and the source file transfer is skipped.
--Example:[user@localhost ~]$ hsync --force ...--
#
max-delete=========================================================================Supported OS : Linux / WindowsFormat : --max-delete=<max-num>-------------------------------------------------------------------------max-numDefault : -1Range of Values : -1, 0 - maximum value of signed integer=========================================================================
The max number of files and directories to be deleted is set.
The max number is set at max-num. When 0 or –1, deleting is not operated.
--Example:[user@localhost ~]$ hsync --max-delete=100 ...--
#
max-size=========================================================================Supported OS : Linux / WindowsFormat : --max-size=<size>-------------------------------------------------------------------------sizeDefault : noneRange of Values : numeric value, numeric string with unit=========================================================================
The maximum size of the file to be transferred is set.
Numeric value or numeric string including the units (B, K, M, G, T, P) can be set as the maximum file size. Please find the format of the numeric string with the units on the following website.
https://download.samba.org/pub/rsync/rsync.1--max-size=SIZE
The following setting items that limit the size of the file used in the hcp commands are ignored in the hsync ones.
- MaxReceiveFileSize
- MaxSendFileSize
--Example:[user@localhost ~]$ hsync --max-size=1000 ...[user@localhost ~]$ hsync --max-size=1.5mb-1 ...--
#
min-size=========================================================================Supported OS : Linux / WindowsFormat : --min-size=<size>-------------------------------------------------------------------------sizeDefault : noneRange of Values : numeric value, numeric string with unit=========================================================================
The minimum size of the file to be transferred is set.
Numeric value or numeric string including the units (B, K, M, G, T, P) can be set as the minimum file size. It supports the same format as --max-size.
--Example:[user@localhost ~]$ hsync --min-size=1000 ...[user@localhost ~]$ hsync --min-size=1.5mb-1 ...--
#
partial=========================================================================Supported OS : Linux / WindowsFormat : --partial=========================================================================
This tells hsync to keep files on the receiver side which are aborted on transfer.
--Example:[user@localhost ~]$ hsync --partial ...--
#
partial-dir=========================================================================Supported OS : Linux / WindowsFormat : --partial-dir=<dir_path>-------------------------------------------------------------------------dir_pathDefault : noneRange of Values : path string of file system=========================================================================
This option specifies a directory path to keep files which are aborted on transfer. When the path is a relative one, a directory to keep an aborted file will be created at a directory where hsync writes the file on the receiver side.
If hsync detects an aborted file on the directory, it tries to resume the file. Only using --partial dose not make this resuming operation.
--Example1:[user@localhost ~]$ hsync --partial-dir=_part_dir_ ...Example2:[user@localhost ~]$ hsync --partial-dir=/home/user/_part_dir_ ...--
#
m, prune-empty-dirs=========================================================================Supported OS : Linux / WindowsFormat : -m | --prune-empty-dirs=========================================================================
This option instructs not to transfer empty directories.
It is useful to avoid unnecessary filter-rule checking by include/exclude/filter.
--Example:[user@localhost ~]$ hsync -m ...--
#
numeric-ids=========================================================================Supported OS : LinuxFormat : --numeric-ids=========================================================================
This option instructs to maintain the file ownership and group at the destination with UID/GID in the source file.
--Example:[user@localhost ~]$ hsync -o -g --numeric-ids ...--
#
usermap=========================================================================Supported OS : LinuxFormat : --usermap=<mapping>[,<mapping>...]-------------------------------------------------------------------------mappingDefault : noneRange of Values : string describing user mapping by its names and UIDs=========================================================================
When maintaining the sender’s ownership in a destination file by the --owner option, it instructs to do that after specified user mapping.
A string described user mapping is set in mapping. The source can be a username or UID value. The destination can be a username or UID value as well. Please refer to the following web site regarding the format.
https://download.samba.org/pub/rsync/rsync.1--usermap=STRING, --groupmap=STRING
--Example:[user@localhost ~]$ hsync -o --usermap=0-99:nobody,wayne:admin,*:normal ...--
#
groupmap=========================================================================Supported OS : LinuxFormat : --groupmap=<mapping>[,<mapping>...]-------------------------------------------------------------------------mappingDefault : noneRange of Values : string describing group mapping by its names and GIDs=========================================================================
When maintaining the sender’s group in a destination file by the --group option, it instructs to do that after specified group mapping.
A string described group mapping is set in mapping. The source can be a group name or GID value. The destination can be a group name or GID value as well. Please refer to the following web site regarding the format.
https://download.samba.org/pub/rsync/rsync.1--usermap=STRING, --groupmap=STRING
--Example:[user@localhost ~]$ hsync -g --groupmap=usr:1,1:usr ...--
#
chown=========================================================================Supported OS : LinuxFormat : --chown=<user>[:<group>]-------------------------------------------------------------------------userDefault : noneRange of Values : user name-------------------------------------------------------------------------groupDefault : noneRange of Values : group name=========================================================================
It instructs to apply the supecified username and group name to the owner and group.
This option adopts the --usermap or --groupmap option. For example, the following two commands result in the same.
[user@localhost ~]$ hsync --chown=foo:bar ...[user@localhost ~]$ hsync --usermap=*:foo --groupmap=*:bar ...
#
I, ignore-times=========================================================================Supported OS : Linux / WindowsFormat : -I | --ignore-times=========================================================================
It instructs to copy file even if its size and update time are the same between source and destination.
--Example:[user@localhost ~]$ hsync -I ...--
#
size-only=========================================================================Supported OS : Linux / WindowsFormat : --size-only=========================================================================
It instructs to copy files as long as their size are different between source and destination. The update time is ignored. Even when the update time is the same, the file is copied.
--Example:[user@localhost ~]$ hsync --size-only ...--
#
@, modify-window=========================================================================Supported OS : Linux / WindowsFormat : -@<mod_win_time> | --modify-window=<mod_win_time>-------------------------------------------------------------------------mod_win_timeDefault : 0Range of Values : modification window time (in secs)=========================================================================
This option specifies a modification window time that indicates a margin to compare timestamps of files for determining a file is newer, older or equal to another one.
When 0 is set, hsync determines two files are same in time if timestamps of them completely matches in seconds. When a value over 0 is set, it dose if the difference of their timestamps is in range of the value.
Any negative value is not supported (in rsync, it is supposed to specify a nanoseconds).
--Example:[user@localhost ~]$ hsync --modify-window=3 ...// Files whose difference of timestamps is under 3 seconds or equals to it will be decided as same files in time.--
#
T, temp-dir=========================================================================Supported OS : Linux / WindowsFormat : -T<dir_path> | --temp-dir=<dir_path>-------------------------------------------------------------------------dir_pathDefault : noneRange of Values : path string of file system=========================================================================
This option specifies a directory path to make temporary files.
When the path is a relative one, an existing directory on the destination directory given from the command line will be used. When this option is not set, a temporary file of each file will be created at a directory where hsync writes the file on the receiver side.
Transfer of files results in failure if the directory indicated by this option dose not exist on the receiver side.
--Example1:[user@localhost ~]$ hsync --temp-dir=_temp_dir_ ... /path/to/src 192.168.1.100:/path/to/dst// /path/to/dst/_temp_dir_ is the temporary directory of this transfer.Example2:[user@localhost ~]$ hsync --temp-dir=/home/user/_temp_dir_ ...--
#
z, compress=========================================================================Supported OS : Linux / WindowsFormat : -z | --compress=========================================================================
It instructs to compress files data to send.
This command compresses all messages communicating with a server, such as messages including file data, control messages to request sending files, etc.
--Example:[user@localhost ~]$ hsync -z ...--
#
compress-level=========================================================================Supported OS : Linux / WindowsFormat : --compress-level=<level>-------------------------------------------------------------------------levelDefault : 5Range of Values : 0 - 9=========================================================================
It set the compress level.
--Example:[user@localhost ~]$ hsync --compress-level=5 ...--
#
f, filter=========================================================================Supported OS : Linux / WindowsFormat : -f <filter-desc> | --filter=<filter-desc>-------------------------------------------------------------------------filter-descDefault : noneRange of Values : filter strings=========================================================================
It adds the filter to select a file. The filters (including --exclude, --exclude-from, --include, --include-from as will be described later.) are applied in the order of the description. Please refer to the following description on its format and rules, etc.
https://download.samba.org/pub/rsync/rsync.1FILTER RULESINCLUDE/EXCLUDE PATTERN RULESMERGE-FILE FILTER RULESLIST-CLEARING FILTER RULEANCHORING INCLUDE/EXCLUDE PATTERNSPER-DIRECTORY RULES AND DELETE
The following functions have not yet been implemented on this version.
- Merge filter(merge, dir-merge)
- “/”, “C”, “s”, “r”, “p”, “x” among exclude/include modifiers.
--Example:// Search for any .c files in all directories and copy them.[user@localhost ~]$ hsync --filter="+ */" --filter="+ *.c" --filter="- *" ...// The same result as the above command[user@localhost ~]$ hsync --include="*/" --filter="+ *.c" --exclude="*" ...--
#
exclude=========================================================================Supported OS : Linux / WindowsFormat : --exclude=<exclude-desc>-------------------------------------------------------------------------exclude-descDefault : noneRange of Values : excluded filter strings=========================================================================
It adds excluded filters. Please refer to the following description on its format and rules, etc.
https://download.samba.org/pub/rsync/rsync.1FILTER RULESINCLUDE/EXCLUDE PATTERN RULES
In this option, modifiers for the exclude rule described earlier cannot be described. When “+ ” is put at the beginning, the include rule is adopted. When “!” is put at the beginning, the clear rule is adopted.
--Example:[user@localhost ~]$ hsync --exclude="*.c" ...--
#
exclude-from=========================================================================Supported OS : Linux / WindowsFormat : --exclude-from=<file>-------------------------------------------------------------------------fileDefault : noneRange of Values : path string of file to read excluded rules=========================================================================
It adds a file to read excluded rules. Please refer to the following description on its format and rules, etc.
https://download.samba.org/pub/rsync/rsync.1FILTER RULESINCLUDE/EXCLUDE PATTERN RULES
When another filter rules are specified before and after, the rule read from a file is put between them.
--Example:[user@localhost ~]$ cat .exclude-rule*[user@localhost ~]$ hsync --include="*/" --include="*.c" --exclude-from=".exclude-rule" ...--
#
include=========================================================================Supported OS : Linux / WindowsFormat : --include=<include-desc>-------------------------------------------------------------------------include-descDefault : noneRange of Values : included filter strings=========================================================================
It adds included filters. Please refer to the following description on its format and rules, etc.
https://download.samba.org/pub/rsync/rsync.1FILTER RULESINCLUDE/EXCLUDE PATTERN RULES
In this option, modifiers for the include rule described earlier cannot be described. When “- ” is put at the beginning, the exclude rule is adopted. When “!” is put at the beginning, the clear rule is adopted.
--Example:[user@localhost ~]$ hsync --include="*.c" ...--
#
include-from=========================================================================Supported OS : Linux / WindowsFormat : --include-from=<file>-------------------------------------------------------------------------fileDefault : noneRange of Values : path string of file to read included rules=========================================================================
It adds a file to read included rules. Please refer to the following description on its format and rules, etc.
https://download.samba.org/pub/rsync/rsync.1FILTER RULESINCLUDE/EXCLUDE PATTERN RULES
When another filter rules are specified before and after, the rule read from a file is put between them.
--Example:[user@localhost ~]$ cat .include-rule*/*.c[user@localhost ~]$ hsync --include-from=".include-rule" --exclude="*" ...--
#
files-from=========================================================================Supported OS : Linux / WindowsFormat : --files-from=<file>-------------------------------------------------------------------------fileDefault : noneRange of Values : path string of file to read a file list=========================================================================
This tells hsync to read a list of files from the specified file.
--Example:[user@localhost ~]$ hsync --files-from=source.file.list ...--
#
stats=========================================================================Supported OS : Linux / WindowsFormat : --stats=========================================================================
This tells hsync to output statistics data of file transfer.
When the verbosity by -v option is 0 or 1, logs of STATS2 will be output.
--Example:[user@localhost ~]$ hsync --stats ...--
#
h, human-readable=========================================================================対応OS : Linux / Windows書式 : -h | --human-readable=========================================================================
This tells hsync to output numbers in a human-readable format.
--Example:[user@localhost ~]$ hsync --human-readable ...--
#
progress=========================================================================Supported OS : Linux / WindowsFormat : --progress=========================================================================
This tells hsync to output progress of file transfer.
However, printing a ratio of transferred bytes is not supported.
When NAME1 and PROGRESS1 by --info options are set, the same output will be produced.
--Example:[user@localhost ~]$ hsync --progress ...--
#
P=========================================================================Supported OS : Linux / WindowsFormat : -P=========================================================================
This tells hsync to enable --partial and --progress.
--Example:[user@localhost ~]$ hsync -P ...--
#
i, itemize-changes=========================================================================Supported OS : Linux / WindowsFormat : -i | --itemize-changes=========================================================================
This tells hsync to print a summary of changing files. When --out-format=“%i %n%L” is set, the same output will be produced.
For the field of ‘Y’, “h”, “.” and “*” will not be produced.
For the field of ‘u(n|b)’, ‘a’ and ‘x’, only “.”, “+” and “?” will be produced due to no support for —atime, etc.
--Example:[user@localhost ~]$ hsync --itemize-changes ...--
#
out-format=========================================================================Supported OS : Linux / WindowsFormat : --out-format=<format>-------------------------------------------------------------------------formatDefault : %n%LRange of Values : format specification string=========================================================================
This tells a format specification string to hsync for logging updates of files. It supports the following items.
- %B Permission
- %C Checksum (Hex notation)
- %G GID
- %i --itemize-changes
- %L Symbolik link target name
- %l File size
- %M Modification date and time
- %n File name
- %o Operation name (send or recv)
- %p Process ID
- %t Current date and time
- &u User name
- %U UID
--Example:[user@localhost ~]$ hsync --out-format="%i %l %n%L" ...--
#
stop-at=========================================================================Supported OS : Linux / WindowsFormat : --stop-at=at=<timestamp-desc>-------------------------------------------------------------------------timestamp-descDefault : noneRange of Values : y-m-dTh:m=========================================================================
This specifies an expire of file transfer running by a date and time.
If the transfer continues at the date and time, hsync will abort the transfer.
--Example:[user@localhost ~]$ hsync --stop-at=2022-1-1[user@localhost ~]$ hsync --stop-at=1-1 // until 1/1 00:00 the next year[user@localhost ~]$ hsync --stop-at=30 // until 00:00 the next 30th[user@localhost ~]$ hsync --stop-at=12:00 // until the next 12:00 (of today or tomorrow)[user@localhost ~]$ hsync --stop-at=:30 // until the next xx:30--
#
stop-after=========================================================================Supported OS : Linux / WindowsFormat : --stop-after=<mins-desc>-------------------------------------------------------------------------mins-descDefault : -1Range of Values : -1, 0 - maximum value of signed integer (minute)=========================================================================
The maximum execution time is set.
The maximum execution time is specified in the minute unit. When –1 is set, the limitation is not set.
When the execution time passes but copying hasn’t been completed, copying is suspended.
--Example:[user@localhost ~]$ hsync --stop-after=30 ...--
#
Data Flow Control, Bandwidth Control#
bwlimit=========================================================================Supported OS : Linux / WindowsFormat : --bwlimit=<bw-desc>-------------------------------------------------------------------------bw-descDefault : noneRange of Values : numeric value (byte), throughput string with unit (byte)=========================================================================
The maximum bandwidth for sending and receiving is set.
bw-desc is numeric value or string for specifying throughput with B, K, M, G, T, or P. The unit is byte. The format is the same as —max-size.
How to limit the bandwidth by this option is the same method as MaxSendRate/MaxReceiveRate in the settings.
--Example:[user@localhost ~]$ hsync --bwlimit=1000000 ...[user@localhost ~]$ hsync --bwlimit=1mb ...--
#
Retransmission Function#
auto-rerun=========================================================================Supported OS : Linux / WindowsFormat : --auto-rerun=========================================================================
It automatically restarts synchronization when transmission stops due to network errors. However, in the case that a user stops copying by Ctrl+C, it doesn't restart it at that time.
If AutoRerunTrials is unlimited and you uses the option of --ignore-times, the starting synchronization will be stopped without running.
It is recommended to use private keys that are not encrypted by passpharses for this purpose. If you need the passphrases, hcp make a cache on the memory of that passphrase to prevent interactive prompts from being shown for re-authentication.
#
Log Management#
v, verbose=========================================================================Supported OS : Linux / WindowsFormat : -v | --verbose=========================================================================
The redundancy level of the application outputs is raised by one step. As it goes up, more detailed and more information is output.
hsync produces the following logs each verbosity.
-v : NAME1, STATS1, DEL1
-vv : SKIP
-vvv : none
DEL1 dose not make logs about sub directories in some cases, e.g. using —delete-excluded.
--Example:[user@localhost ~]$ hsync -v ...[user@localhost ~]$ hsync -vv ...--
#
info#
q, quiet=========================================================================Supported OS : Linux / WindowsFormat : -q | --quiet=========================================================================
Suppress log outputs.
--Example:[user@localhost ~]$ hsync -q ...--
#
log-file=========================================================================Supported OS : Linux / WindowsFormat : --log-file=<file>-------------------------------------------------------------------------fileDefault : noneRange of Values : path string of file system=========================================================================
This tells hsync to output progress logs of file transfer to a log file. This output will be performed in addition to output to the standard output.
--Example:[user@localhost ~]$ hsync --log-file=hsync.log --exclude="hsync.log" ...--
#
hcp-log-filePlease refer to the --log-file option of the hcp command.
#
hcp-stat-log-filePlease refer to the --stat-log-file option of the hcp command.
#
Software Information Update#
V, version=========================================================================Supported OS : Linux / WindowsFormat : -V | --version=========================================================================
The hsync command version is shown.
--Example:[user@localhost ~]$ hsync -Vhsync client (hsync) 1.3.4_3 / Linux (HpFP2 2.0.0.91_21 WSAPI 0.0.1.30 WS 4.2.0-1)--
#
config-test=========================================================================Supported OS : Linux / WindowsFormat : --config-test=========================================================================
The hsync command parameters and configuration parameters are shown.
--Example:[user@localhost ~]$ hsync --config-test...
Number of Logical Processors : 2Number of Physical Processors : 2
Command parameters verbose : 0 info : - quiet : disable checksum : disable archive : disable recursive : disable relative : disable no-implied-dirs : disable backup : disable backup-dir : - suffix : - update : disable inplace : disable dirs : disable links : disable copy-links : disable copy-unsafe-links : disable safe-links : disable copy-dirlinks : disable keep-dirlinks : disable perms : disable executability : disable chmod : - owner : disable group : disable devices : disable specials : disable -D : disable times : disable omit-dir-times : disable omit-link-times : disable super : disable no-super : disable dry-run : disable auto-rerun : disable whole-file : disable existing : disable ignore-existing : disable delete : disable delete-before : disable delete-during : disable delete-delay : disable delete-after : disable delete-excluded : disable force : disable max-delete : - max-size : - min-size : - partial : disable partial-dir : - prune-empty-dirs : disable numeric-ids : disable usermap : - groupmap : - chown : - ignore-times : disable size-only : disable modify-window : 0 temp-dir : - compress : disable compress-level : 5 filter : - exclude : - exclude-from : - include : - include-from : - files-from : - stats : disable human-readable : disable progress : disable -P : disable itemize-changes : disable out-format : - log-file : - bwlimit : - stop-at : - stop-after : -1 user : disable password : disable version : disable help : disable mcd : -
Configuration parameters PubkeyAuthentication : yes WinLogonUserAuthentication : yes PAMAuthentication : yes LocalPasswordAuthentication : yes CompressLevel : -1 StrictHostKeyChecking : ask PrivateKeyFile : - [~/.hcp/id_rsa] TransportTimeout : 180 AcceptableCryptMethod : AES256/GCM AES256/CTR/VMAC AES256/CBC AES128/CBC [Intel:AES-NI=yes] AcceptableDigestMethod : XXH3 MM128 SHA256 SHA160
Please type '--config-test --config-test ...' for more details.
#
h, help=========================================================================Supported OS : Linux / WindowsFormat : -h | --help=========================================================================
The help information on the hsync commands is shown.
When the abbreviation is specified, this option works as long as the destination and source paths are not specified.
--Example:[user@localhost ~]$ hsync -h--