Running async |
This topic describes async command-line options, including definitions, allowable values, and defaults. Examples of async input and output are provided after the options tables. async can be run as a direct replacement for uni-directional, rsync-style replications (push or pull directions), or for bi-directional synchronization.
Basic usage is as follows:
# async [instance_options] -N pair -d ldir -r [user@host:rdir] [session_options] ...
Naming the async session: -N pair
-N pair is required in async commands. The value for pair is a name that uniquely identifies the Sync session and is visible in Aspera Console. -N pair must follow any instance options and must precede all session arguments. Names can only use standard alphanumeric characters, plus "_" and "-" characters. See examples below.
Specifying filepaths and filenames: ldir and rdir
ldir specifies the local directory to be synchronized and rdir specifies the remote directory to be synchronized. File paths and filenames must follow these rules:
Specifying the direction of the sync: -K direction
The following tables are complete command-line options references. View an abbreviated version from the command line by running async -h.
Option (- Short form / -- Long form) | Description |
---|---|
-A |
Display the async version information and license information. |
-h |
Display help for command-line options. |
-D[D..] | Debug level. Default is 0. |
-q |
Disable progress display. |
-L localdir |
Specify a logging directory on the local host. If the directory doesn't exist, async creates it for you. |
--watchd=datastore:host:port[:domain] |
Use asperawatchd connected to the specified Redis for the transfer
session. redis is the only accepted
datastore for this option. For
example:
--watchd=redis:localhost:31415 The optional domain argument allows you to specify if the domain is other than the default root. |
--apply-local-docroot |
Prepend the local docroot to the local directory. |
Option | Description |
---|---|
-N pair |
Name for the synchronization pair, which can be any string used to
identify the connection. This value is stored in the session cookie and can
be used in Aspera Console to identify the transfer session's name. It can
contain only ASCII alphanumeric, hyphen, and underscore characters.
-N must precede any combination of the options below. |
-d ldir |
Set the local sync directory to ldir. You can use --create-dir (described below) to create the remote directory if it does not already exist. |
-r rdir |
Set the remote sync directory to rdir, where
rdir=[user@host:path].
You can use the --create-dir option (described below) to
create the remote directory if it does not already exist. CAUTION: For a local synchronization, do not specify a remote
(destination) directory that is located inside your source directory.
|
--host=host |
The name of the remote host. When host is specified with this
option, the characters "@" and ":" are no longer treated specially in
the argument to -r, so may appear in any such name. If
--host=host is specified, the remote
username cannot be extracted from the argument for
--remote-dir and must be supplied by a
--user=name option or in the
environment variable $user (on Windows, %USER%). Allowed
forms are as
follows:--remote-dir user@host:/rootdir # (old method) --user user --remote-dir host:/rootdir --host host --user user --remote-dir /rootdir --remote-dir host:/rootdir # (uses $user) --host host --remote-dir /rootdir # (uses $user) The following means the same as the first three lines above: -r /rootdir --user=user --host=host For backward compatibility, -r A:/rootdir for any single letter A is still taken as a Windows path, not as --host A -r /rootdir. To specify a one-letter host name A, use an explicit --host=A. |
--user=user | The name of the remote user. When --user=user is specified, the character "@" is no longer treated specially in the argument to -r, so may appear in any such name. |
-w pass |
Set the passphrase string to the user's password. |
-i file |
The SSH private key file. For information on creating a key pair, see Creating SSH Keys (Terminal). |
--check-sshfp=fingerprint |
Compare fingerprint to remote host key hash, fail on mismatch. |
-K direction |
Set the transfer direction. direction can be push, pull, or bidi (bi-directional). (Default: push) |
-k type |
Set the checksum type. type can be sha1, md5, sha1-sparse, md5-sparse, or none. A value of none is equivalent to a size check only and async will not detect a change in timestamp. (Default: sha1-sparse) |
-P port |
Set the TCP port for SSH. port must be valid numeric IP port. (Default: 22) |
-O port |
Set the UDP port used by FASP for data transfer. (Default: 33001) |
-a policy |
Set the transfer rate policy. policy can be fixed, fair, high, or low. (Default: fair) |
-l rate |
Set the maximum transfer rate. rate=integer G/g, M/m, K/k, or bps. (Default: 10 Mbps) |
-m rate |
Set min transfer rate. rate=integer G/g, M/m, K/k, or just bps. (Default: 200 Kbps) |
-g size |
Set block size for reading. size=integer K, M, or just bytes. (Default: 64MB) |
-G size |
Set block size using for writing. size=integer K, M, or just bytes. (Default: 64MB) |
-H val |
Set the intensity for scanning work. val can be one of vlow, low, medium, high, or vhigh. vlow minimizes system activity. vhigh maximizes system activity by continuously scanning files without rest. (Default: medium) |
-R remdir |
Specify a logging directory on the remote host. |
-Z mtu |
Specify the datagram size (mtu) as an integer. (Default: detected-path MTU) |
-X size |
Set the size (in bytes) of a retransmission request (Maximum: 1440). |
-c cipher |
Set encryption algorithm. cipher can be none, AES128. (Default: AES128) |
-b ldbdir |
Local database directory. (Default: .private-asp
at the root level of the synchronized directory) You may relocate the snapshot database to a different location than the default one under the ldir specified with -d. This allows placing the database away from the main data files. This is useful for performance tuning. It is also useful when -d ldir is located on a network share volume that does not reliably support database locking. For further usage information, see Multiple Databases (Snap DB). |
-B rdbdir |
Remote database directory. Similar to -b above, but for the remote database. For further usage information, see Multiple Databases (Snap DB). (Default: .private-asp at the root level of the synchronized directory) |
-I file |
Scan paths identified in the filter file. |
-E file |
Skip paths identified in the filter file. |
--include=pattern |
Include and exclude paths that match pattern. For more information on how to set include and exclude patterns, see Include/Exclude Filtering Rules. |
--exclude-dirs-older-than=MTIME |
After the initial Sync scan, do not scan directories during subsequent syncs if they or their parents have a recursive modified time older than the specified value. The recursive modified time of a directory is the most recent modification time of it or any of its children (file or directory). This option is used to avoid rescanning directories that are known to have not changed since the previous Sync, such as a monthly archive directory structure in which only the most recent subdirectory is being modified. MTIME may be specified in any one of the following ways:
This option does not apply to the root directory. Note: Sync fails if the first run of async and the next
run do not use the same --exclude-dirs-older-than
option. If the first run specifies
--exclude-dirs-older-than, then the next run must
use this option, too. If the first run does not include
--exclude-dirs-older-than, then the next run fails
if this option is specified.
|
-n action |
Treat symbolic links per the specified action. Permitted values are: copy - create (or update) the link at the destination. (Not valid for Windows source or destination.) skip - ignore the link altogether. follow - treat the link as if it were the file (or directory) it points to, so that at the destination, what was a link will now be a copy of the file (or directory). (Functions as skip if source is Windows.) (Default: copy) See Configuring Symbolic Links for more information on using symbolic links. |
-C |
Run continuous synchronization. If you receive an inotify
error when attempting to run continuous synchronization, see Error Troubleshooting. If a file is open, async cannot transfer the file due to sharing violations and may ignore the file if it is closed without changes. To specify the maximum number of retries after a sharing violation, use the --sharing-retry-max=N option. To enable periodic scans that detect when an opened file has been closed and can be transferred, use the --scan-interval=duration option. Note: Continuous mode is not supported on Mac OS X. Other machines can run a continuous sync with a Mac OS X machine only in push mode. |
-t |
Preserve file timestamps. |
--preserve-access-time | Set the access time of the destination file to the same value as that of the source file. |
--preserve-modification-time | Set the modification time of the destination file to the same value as that of the source file. |
--preserve-creation-time | Set the creation time of the destination file to the same value as that of the source file. Only valid on Windows machines. |
-u |
Preserve file owner's uid or gid. This preserve option requires that async is running as root. |
--write-uid=uid |
Write files as the user uid or the group
gid.
uid and
gid may be numeric, or by name.
If by name, the name is looked up on the host actually performing the write.
Failure to set the uid or
gid is logged, but is not an
error. The uid or
gid is set after
ascp completes and before moving the file from the
staging directory to the final location.
--write-uid=uid conflicts with --preserve-uid and --write-gid=gid conflicts with --preserve-gid. |
--scan-dir-rename | Enable detection of renamed directories and files on the initial scan. Results are only relevant if the nodes for your file system are stable. |
--scan-file-rename | Enable detection of renamed files on the initial scan. Results are only relevant if the nodes for your file system are stable. |
-o policy |
Set the overwrite policy. policy can be
always, older, or conflict. Use with -K
push and pull. (Default: always for -K
push and pull; conflict for -K
bidi) --overwrite=older is only accurate if the user also specifies --preserve-time (preserve timestamps). To resolve conflict and error situations in a uni-directional sync, “touch” the problem files on the source and run async with --overwrite=always. This clears allconflict and error states as the problem files are synced. |
-x |
Clear the async snapshot database and rescan the synchronized directories and files to create a fresh snapshot. |
--assume-no-mods | Only propagate create/delete/move. In other words, when running async in non-continuous mode, it does not scan a directory if the modification time is unchanged (compared to the current snapshot). |
--ignore-delete | Do not copy removals to the peer. This option is used mostly with uni-directional syncs. In bi-directional sync, a deletion on one side is ignored but the next time async is run, the file is recopied from the other end. In continuous mode, the file is not recopied until either async is restarted or the file is changed (touched). |
--delete-delay | Postpone actual deletion of files or directories until the end of the sync session. |
--keep-dir-local=dir | Move deleted files under dir. Note that dir must exist (it is not created by --create-dir), and must be outside the synchronization directory, but on the same file system. |
--keep-dir-remote=dir | Move the server's deleted files under dir. Note that dir must exist (it is not created by --create-dir), and must be outside the synchronization directory, but on the same file system. |
--local-mount-signature=signature file | Verify that the local file system is mounted by the existence of this file. Use of this feature increases the time to synchronize deletes. |
--remote-mount-signature=signature file | Verify that the remote file system is mounted by the existence of this file. Use of this feature increases the time to synchronize deletes. |
--create-dir | Create the remote directory if it does not exist. This option is used with the -d and -r options (async creates directories if they do not exist, rather than reporting an error and quitting). |
--dedup[=mode] | If duplicate files are encountered, take the action specified by mode, which can be hardlink or copy. In either mode, only a single copy of duplicate files is transferred. With --dedup=hardlink, the files are then replicated at the destination by means of hardlinks. With --dedup=copy, the files are replicated at the destination by copying. (Default: hardlink) |
--no-scan | Skip initial scanning. |
--cooloff=sec | Number of seconds to delay the start of the transfer. For example, if --cooloff=5, async waits 5 seconds before copying a file. If --cooloff=0 transfers start immediately. Note that both peers get the same cooloff period. The permitted value for sec is any integer from 0 to 60. (Default: 3) |
--pending-max=N | This option acts as a buffer to ensure that files to be transferred do not exceed the maximum. (Default: 2000) |
--sharing-retry-max=N | Maximum number of times to retry after a sharing violation. The interval between retries is the number of seconds specified by --cooloff. (Default: 3) Not supported |
--preserve-acls=mode | Preserve the ACL access data from Windows or OS X files if the preservation
mode is native or metafile.
(Default: none) If mode is native, async expects that the destination supports the same native ACL format as the source; if not, it generates an error and exits. If mode is metafile, async writes the access data to a separate file in the same location; the file has same name but with the added extension .aspera-meta. Metafile data is in a generic format that can reside on any platform and also be reconverted to native form if the file is again synced with a system that supports it. If mode is none, no ACL data is preserved at all. This feature is only meaningful if both hosts are in a common security domain. If a SID (security ID) in a source file does not exist at a destination, the sync proceeds but no ACL data is saved and the log records that the ACL could not be applied. Note: Both --preserve-acls and --remote-preserve-acls must be specified in order for the target side of the pull to apply the acls. |
--preserve-xattrs=mode |
Preserve OS X extended attributes data (xattr) if preservation mode is native or metafile. (Default: none) If the sync is run by a regular user, only user-level attributes are preserved. If run as superuser, all attributes are preserved. If mode is native, async expects that the destination supports the same native xattr format as the source; if not, it generates an error and exits. If mode is metafile, async writes the xattr data to a separate file in the same location; the file has the same name with the added extension .aspera-meta. The aspera-meta files are platform-independent and can be copied between hosts without loss of data. They can be reconverted to the native form if the file is again synced with an OS X system. If mode is none, no xattr data is preserved at all. |
--remote-preserve-acls=mode | Like --preserve-acls but used when ACLs are stored in a different
format on the remote host. Defaults to the value of
--preserve-acls. Note: Both --preserve-acls and --remote-preserve-acls must be specified in order for the target side of the pull to apply the acls. |
--remote-preserve-xattrs=mode | Like --preserve-xattrs but used attributes are stored in a different format on the remote systgem. Defaults to the value of --preserve-xattrs. |
--compression=mode | Specify method used to compress a file before transfer. mode can be zlib or none. The default value is none. |
--transfer-threads=N[:size] | Specify intervals for dedicated transfer threads. N corresponds to the number of threads used to process files smaller or equal to the specified size. If no size is specified, infinity is used as an upper bound. |
--remove-after-transfer | Remove source files after they are successfully synchronized. |
--scan-interval=duration | Enable periodic scans. duration defines the interval between periodic scans. duration may be specified as DDd HH:MM:SS.mmm or NNw NNd NNh NNm NNs NNms NNus. Leading zero fields may be omitted. Spaces may be omitted. A plain number NN will be interpreted as NNs (seconds). Can only be used with continuous mode, and is not supported when a Mac OS X machine is the source. |
--remote-scan-interval=duration | Like --scan-interval but scanning the remote machine. |
--no-preserve-root-attrs | Disable preservation of attributes on Sync root. |
$ async -N TestBackup -d /tmp/dir -r user@server:/tmp/dir -w passwd -K bidi -a fair -l 30000
$ async -N TestBackup -d /tmp/dir -r user@server:c:/tmp/dir -w passwd -K bidi -a fair -l 30000
> async -N TestBackup -d c:/tmp/dir -r user@server:d:/tmp/dir -w passwd -K bidi -a fair -l 30000
> async -N TestBackup -d c:/tmp/dir -r user@server:/tmp/dir -w passwd -K bidi -a fair -l 30000
When Sync is run in interactive mode, the status of each file in the synchronized directory is displayed in a list similar to the following:
/file1 SYNCHRONIZED /file2 SYNCHRONIZED(exs) /file3 SYNCHRONIZED(skp) /file4 SYNCHRONIZED(del)
The status may be one of the following options:
SYNCHRONIZED: file transferred
SYNCHRONIZED(skp): file skipped
SYNCHRONIZED(del): file deleted
SYNCHRONIZED(ddp): dedup (duplicate files present)
SYNCHRONIZED(exs): file exists
SYNCHRONIZED(mov): file has changed (renamed, moved, or different attributes)