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.
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.
subst, they go to the
Recycle Bin of the drive it stands for. Network targets and removable
drives (a USB stick, a memory card) have no recycle bin — there
Permanent is checked and greyed, and Execute asks before
deleting./sync notes
the license in its log./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] [--gitignore]
[--format json --out <file>|- [--max-entries <n>] [--offset <n>]]
[--exclude <patterns>] [--defaults] [--skip-online-only] [--progress] [--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.
/sync, -sync and
--sync are the same. Use --sync in Git Bash,
which rewrites a leading slash into a path: /sync arrives there
as C:/Program Files/Git/sync, and Diffoniq opens its window to
compare that path instead of synchronizing.
--mirror | The 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. |
--update | Copy 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.
--execute nothing is touched. The
run is a dry run: the planned operations are written to the log
file and the exit code reports whether differences exist. Add
--execute — typically after checking the dry-run log
once — to apply the plan.--permanent deletes for good. A subst drive
uses the Recycle Bin of the drive it stands for. Network drives and
removable drives (a USB stick, a memory card) have no recycle bin;
deletions there are always permanent — the log header says
permanent=yes (network path, no recycle bin) or
permanent=yes (removable drive, no recycle bin) already
in the dry run..gitignore hides is never touched.
With --gitignore the .gitignore
rules of both trees are applied as an exclude filter. What both
sides hide is on neither side’s list, so no operation can name
it — a node_modules that exists only in the target
stays where it is even in mirror mode. What only one side’s
rules hide is listed on the other side, and the plan skips it with
the note “the other side’s .gitignore hides it”
instead of copying or deleting it. The log says how many entries the
rules hid. A scripted run never inherits the window’s checkbox:
without the switch, everything is compared.For a script, the dry run can also write its plan as one JSON document:
--format json --out plan.json, or --out - for the
standard output (the log lines then go to the standard error). The document
names both roots, the mode and the criterion, counts every operation in
summary (makeDir, rename,
copyNew, copyChanged, delete,
skip, onlineOnly, bytesToCopy) and lists them in
actions, each with its action, the
target below the right root and, where there is one, the
source, the bytes to copy or the
reason for a skip. --max-entries limits the list;
omitted says how many operations it left out, and
--offset skips the first operations for the next page
(skipped). The JSON describes
the dry run only and is refused together with --execute.
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.
A rename is the exception: a renamed file pairs two different names, where
size and timestamp prove nothing, so Diffoniq reads the two files and renames
only when their content is the same — otherwise the new file is copied
and the old one deleted. A file that a cloud service keeps online only is
not read for this, because reading would download it; such a pair is
copied and deleted like one with different content. A file moved to another
folder under its own name follows the quick rule.
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.
The other settings of the window — for example Ignore Case or the
subfolder depth — do apply. --defaults plans with the
factory settings instead, so a script gets the same plan on every machine;
compare switches on the command line still apply on top.
--exclude "*.bak;tmp" leaves files and folders matching these
wildcard patterns out on both sides, like the
Exclude fields: they are neither copied nor,
in a mirror, deleted.
--skip-online-only keeps --content from
downloading files that a cloud service keeps online only: such a pair is
skipped (reason onlineOnly) instead of being read. Recognized
are the attributes of the Windows cloud files API, which OneDrive, Dropbox
and other providers set, and a whole drive labelled Google Drive,
because Google Drive in streaming mode sets none of them: with the switch
every --content pair of that side is skipped, and the JSON
plan marks the root with cloudDrive. A renamed drive is not
recognized; its files are then read, and downloaded, like ordinary
files.
--progress writes progress lines to standard error while the
folders are listed and read, as described for
/report.
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:
0 | No differences — nothing to do |
1 | Differences found; dry run: reported ·
with --execute: synchronized successfully |
2 | Finished with errors (partially synchronized) |
3 | Invalid 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.
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.
Synchronizing does not need a license: dry run and --execute
work the same in the trial. The log of every run
names the license it saw (license: none (evaluation) on an
unlicensed copy) — no dialog, no exit code, nothing interrupts a
scheduled run. Up to version 2.2, --execute without a license
ended with exit code 3 and did nothing.