commands
synchronize
Make a local and a remote directory match.
Syntax
Section titled “Syntax”synchronize local|remote|both [switches] [<local-directory> [<remote-directory>]]Compares the two directory trees and copies what differs. The first argument picks the direction:
remoteuploads, so the server matches your computer;localdownloads, so your computer matches the server;bothcopies newer files in each direction.
Without directories, the local and remote working directories are used.
Files are replaced without asking. By default only files that are new or
newer on the source side are copied; -mirror and -criteria change that.
Try a new command with -preview first, especially together with
-delete. See Synchronizing directories.
Switches
Section titled “Switches”| Switch | What it does |
|---|---|
-preview |
List what would be copied or deleted, and change nothing. |
-delete |
Delete files and directories in the target that the source does not have. Ignored with both. |
-mirror |
Copy every file that differs, even when the target copy is newer. Ignored with both. |
-criteria=<criteria> |
How files are compared. time, size and checksum can be combined with commas, such as time,size; none copies only missing files; either means time,size. Ignored with both. |
-permissions=<mode> |
Give uploaded files these octal permissions, such as 644. |
-nopermissions |
Let the server choose the permissions of uploaded files. |
-speed=<KB/s> |
Cap the transfer rate in kilobytes per second. |
-transfer=<mode> |
Use binary, ascii (convert line endings) or automatic mode. |
-filemask=<mask> |
Limit the comparison to what this mask selects. |
-resumesupport=<on/off/KB> |
Transfer to a temporary file first, always (on), never (off), or for files larger than the number of KB given. |
Affected by
Section titled “Affected by”reconnecttime (see option).
Examples
Section titled “Examples”See what an upload would change.
synchronize remote -preview -delete /home/alice/site /var/www/htmlBack up a server directory, comparing by size as well as time.
synchronize local -criteria=time,size /home/alice/backup/www /var/www