Folder Synchronization

Diffoniq can synchronize two folders — interactively from a directory comparison, or headless from the command line for scripts and the Windows Task Scheduler. In both cases the same compare engine as the interactive directory comparison (including the persistent hash cache and rename/move detection) decides what to do, then a plan of copy, rename and delete operations is carried out. For driving /sync from scripts or an AI assistant, see Scripting and AI Assistants.

The Synchronize dialog

In a folder comparison, File > Synchronize... opens a preview built from the comparison already on screen — no second scan. Pick the mode (Mirror or Update, see below), the direction (left to right or right to left) and the deletion policy; the action list and the summary line follow immediately. Execute carries out exactly the listed actions with a progress dialog that can be canceled between actions; afterwards the comparison is refreshed from disk.

Command line (/sync)

The headless twin of the dialog — it reports through an exit code and a log file (started through DiffoniqC.exe, the log lines also appear in the console):

Diffoniq /sync <left> <right> (--mirror | --update)
        [--execute] [--content] [--reverify] [--permanent]
        [--log <file>] [compare switches]

From a script, call DiffoniqC.exe: Diffoniq.exe is a windowed program, so a shell neither waits for it nor sees its exit code. The console launcher DiffoniqC.exe next to it takes the same arguments, waits, prints the log lines and returns the exit code (Scripting and AI Assistants). Ctrl+C there stops the sync, also mid-way through --execute. The log file is written to a temporary name and appears only when the run is complete.

Modes

--mirrorThe right folder becomes a mirror of the left one: new and changed files are copied, files existing only on the right are deleted, and files recognized as renamed or moved are renamed on the right instead of being copied again.
--updateCopy only: new and changed files go left → right. Nothing is ever deleted or renamed on the right.

On the command line the direction is always left → right; to synchronize the other way, swap the two path arguments. Both paths must be folders — archives can be compared and viewed, but not used as a synchronization root.

Safety

What counts as “changed”

By default a file pair is compared the quick way — by size and timestamp: a file whose size or last-write time differs counts as changed. Timestamps up to 2 seconds apart count as equal, because FAT drives (many USB sticks) store them in 2-second steps. The window's Ignore Date and Ignore Time settings do not apply here — their factory setting would reduce the check to the size alone and miss an edited file of unchanged size. To ignore timestamps deliberately, say so on the command line (/g t, see Command Line); a size difference is always a change unless Ignore Size is set. With --content the decision is made by file content instead: equal-sized pairs are hash-verified, so a touched-but-identical file is not copied and a same-size/same-date change is still caught. Repeat runs — the scheduler scenario — resolve those hashes from the hash cache almost for free. The cache trusts a file whose size and timestamp did not change; --reverify (implies --content) reads every equal-sized pair again, like Re-verify Contents in the window.

Result: exit code and log

The result of /sync is the process exit code plus a log file — ideal for schedulers, which capture exactly these two things. Started through DiffoniqC.exe, the log lines also appear in the console:

0No differences — nothing to do
1Differences found; dry run: reported · with --execute: synchronized successfully
2Finished with errors (partially synchronized)
3Invalid arguments, or aborted before any operation

The log is written to %APPDATA%\Diffoniq\sync\sync_YYYYMMDD_HHMMSS.log (the 30 newest logs are kept) unless --log <file> names a different location.

Scheduling a nightly sync

Create a scheduled task that runs the sync every night at 02:30:

schtasks /create /tn "Nightly backup sync" /sc daily /st 02:30 ^
  /tr "\"C:\Program Files\Diffoniq\Diffoniq.exe\" /sync D:\work \\nas\backup\work --mirror --execute --log D:\logs\work-sync.log"

Tip: run the same command once without --execute and review the dry-run log before arming the task.

Licensing

During the trial period only dry runs are available; --execute requires a licensed copy and otherwise exits with code 3 (a note is written to the log — no dialog interrupts a scheduled run).