Skip to main content

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 Format#

The 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 List#

The options for the hsync commands are below.

Synchronization

DescriptionShort NameOption Name
Verify transferred files by digest checkcchecksum
Archive mode is -rlptgoDaarchive
Recurse into directoriesrrecursive
Use relative path namesRrelative
Don’t send implied dirs with --relativeno-implied-dirs
Make backupsbbackup
Make backups into hierarchy based in DIRbackup-dir
Backup suffix (default ~)suffix
New files are updateduupdate
Update destination files by in-place copyinplace
Transfer directories without recursingddirs
Copy symlinks as symlinksllinks
Transform symlink into referent file/dirLcopy-links
Only “unsafe” symlinks are transformedcopy-unsafe-links
Ignore symlinks that point outside the treesafe-links
Transform symlink to dir into referent dirkcopy-dirlinks
Treat symlinked dir on receiver as dirKkeep-dirlinks
Preserve permissionspperms
Preserve executabilityEexecutability
Affect file and/or directory permissionschmod
Preserve owneroowner
Preserve groupggroup
Preserve device filesdevices
Preserve special filesspecials
Specify device fies and special filesD
Preserve modification timesttimes
Omit directories from --timesOomit-dir-times
Omit symlinks from --timesJomit-link-times
Receiver attempts super-user activitiessuper
Perform a trial run with no changes madendry-run
Copy files wholeWwhole-file
Skip creating new files on receiverexisting
Skip updating files that exist on receiverignore-existing
An alias for --delete-duringdel
Delete extraneous files from dest dirsdelete
Receiver deletes before transfer, not duringdelete-before
Receiver deletes during the transferdelete-during
Find deletions during, delete after transferdelete-delay
Receiver deletes after transfer, not duringdelete-after
Delete excluded files from dest dirsdelete-excluded
Force deletion of dirs even if not emptyforce
Don’t delete more than NUM filesmax-delete
Don’t transfer any file larger than SIZEmax-size
Don’t transfer any file smaller than SIZEmin-size
Keep partially transferred filespartial
Put a partially transferred file into DIRpartial-dir
Prune empty directory chains from file-listmprune-empty-dirs
Don’t map uid/gid values by user/group namenumeric-ids
Custom username mappingusermap
Custom groupname mappinggroupmap
Simple username/groupname mappingchown
Don’t skip files that match size and timeIignore-times
Skip files that match in sizesize-only
Set the accuracy for mod-time comparisons@modify-window
Create temporary files in directory DIRTtemp-dir
Compress file data during the transferzcompress
Explicitly set compression levelcompress-level
Add a file-filteringffilter
Add a rule to exclude filesexclude
Read exclude patterns from a fileexclude-from
Add a rule to include filesinclude
Read include patterns from a fileinclude-from
Read a list of source-file names from a filefiles-from
Give some file-transfer statsstats
Output numbers in a human-readable formathhuman-readable
Show progress during transferprogress
Specify partial and progress settingsP
Output a change-summary for all updatesiitemize-changes
Output updates using the specified formatout-format
Stop rsync at the specified point in timestop-at
Stop rsync after the specified time have elapsedstop-after

Selectable Communication Method Function

DescriptionShort NameOption Name
The HpFP protocolhpfp
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 protocolws-proxy-direct
Set the Proxy server when the WebSocket protocolws-proxy
Multiple connectionsmcd

Congestion Control

DescriptionShort NameOption Name
Congestion control modes in the HpFP protocolhpfp-cong

Data Flow Control, Message Data Size Control

DescriptionShort NameOption Name
MSS(Maximum Segment Size) in the HpFP protocolhpfp-mss

Data Flow Control, Data Buffer Setting

DescriptionShort NameOption Name
Set the sending buffer size for the HpFP protocolhpfp-sndbuf
Set the receiving buffer size for the HpFP protocolhpfp-rcvbuf

Data Flow Control, Bandwidth Control

DescriptionShort NameOption Name
Limit socket I/O bandwidthbwlimit

Authentication

DescriptionShort NameOption Name
Server certificate checking is disabled in WebSocket protocol communicationswss-no-check-certificate
Specify a username first and synchronizationuser
Specify a password first and synchronizationpassword

Retransmission Function

DescriptionShort NameOption Name
automatically rerunauto-rerun

Various Monitorings

DescriptionShort NameOption Name
Investigation mode starts (deprecated)investigation

Log Management

DescriptionShort NameOption Name
Increase log verbosityvverbose
Set the log verbosity level of INFOinfo
Suppress non-error messagesqquiet
Specify a file where to log progresslog-file
Specify an application log output destinationhcp-log-file
Specify various statistics log output destinationshcp-stat-log-file
Specify an execution record output destinationhcp-out
Start in the multiple-run modemulti-run

Software Information Update

DescriptionShort NameOption Name
Check the application versionVversion
Check the configuration and input parametersconfig-test
Display the command helphhelp

System Operating Environment Settings

DescriptionShort NameOption Name
Setting form a path of the configuration fileconfig-file
Make configuration from command lineconfig-option
Setting by a relative path from the current directoryinclude-conf-from-cwd
Server compatibility disabledno-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-file#

Please refer to the --log-file option of the hcp command.

hcp-stat-log-file#

Please 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--