Guide

Directory synchronization

Synchronization compares two directories. The direction names the side that changes.

DemonstrationHighlight only. No files are compared.
Local folderC:\Projects\site
Remote folder/var/www/html

Remote means the server receives your local changes. Delete, if you enable it later, removes remote files that are not on the PC.

Local means the PC receives remote changes. It can overwrite the project you just edited.

Both updates either side. It is the wrong choice when the PC is the only source.

The highlighted side is the one that changes. Preview the checklist before any delete option.

The situation

A local folder and a remote folder should share a set of files, and you do not want a missing file on the source to delete the other side by surprise.

Prerequisites

Run a previewed sync

  1. Open both folders In Commander, set both panels. In Explorer, choose the local directory in the dialog.
  2. Commands → Synchronize Local updates the PC. Remote updates the server. Both updates either side.
  3. Mode Synchronize files is the normal mode. Mirror files also copies older files.
  4. Preview Leave Preview changes on. Leave Delete files off until the delete list is one you want.
  5. Checklist Apply it only when every line is expected.

Keeping a remote directory up to date repeats a remote sync as local files change. Point it at a folder you are willing to publish, not at a directory of drafts and credentials.

Example directions

C:\Projects\site edited on the PC, public files in /var/www/html. Direction Remote publishes your newer files. Direction Local overwrites the project with the server. Both is not “my PC is the source.”

Scripts use the same words: synchronize remote, synchronize local, and -preview to list changes without applying them. -delete does nothing in both mode. The script will not ask before replacing files.

Expected result

With preview on and delete off, the chosen side gains missing or newer files and keeps files that exist only there. A website still needs a browser check, because the web root and the synced folder are sometimes different.

Common mistakes

Security

The source folder is copied as it stands, including keys and database dumps if they are in it. Remote delete is not a recycle bin. On S3, delete removes objects, and a folder is only a prefix. Preview against a test directory when the destination is live.

Troubleshooting

If every file looks changed, suspect timestamps. SFTP and FTP MLSD are supposed to use UTC, and some servers still mishandle daylight-saving time. A session log shows the values compared. Remove account details before you share it. An empty checklist usually means the wrong remote directory.

Winsaip is an independent educational resource and is not affiliated with or endorsed by the developers of WinSCP.