Skip to content
linscpSecure file transfer for Linux and Windows
GitHub

commands

synchronize

Make a local and a remote directory match.

Generated from linscp 0.6.1
synchronize local|remote|both [switches] [<local-directory> [<remote-directory>]]

Compares the two directory trees and copies what differs. The first argument picks the direction:

  • remote uploads, so the server matches your computer;
  • local downloads, so your computer matches the server;
  • both copies 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.

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.

reconnecttime (see option).

See what an upload would change.

Terminal window
synchronize remote -preview -delete /home/alice/site /var/www/html

Back up a server directory, comparing by size as well as time.

Terminal window
synchronize local -criteria=time,size /home/alice/backup/www /var/www