A method of syncing an unsystematic subset of files and folders

Note: This addin has now been replaced by this far more general addin:


Purpose:
I have several situations where I want to sync only an unsystematic subset of the files and subdirectories in a particular directory. With some vital clues from leo and also from tbone and jon, I wrote a procedure to tag each not-to-be-synced item by creating a hidden file 'Sync.txt' in its alternate data stream. It's very simple-minded, in that files are not synced if and only if:
'Sync.txt' exists and its first line is 'No'.

Download:

  1. THE BUTTON-SCRIPT: The first file below is a button-script that creates a hidden file 'Sync.txt' for each selected item if it is not already there, then toggles its first line between 'No' (not synced) and (synced). Download this button-script, put DOpus into 'Customise' mode, and drag it to a convenient place on the toolbar.

. Sync.dcf (7.87 KB)
2. THE SCRIPT ADDIN: The next file below is a script addin that allows you to add a new column to the lister showing whether each item is to be excluded or not. Download this file, open Preferences - - > Toolbars - - > Scripts and drag it onto the list. After this, you can add the column to any lister by:
right-click on the column headings - - > Columns - - > Script - - > Sync
Better, a button to toggle the column can be created, with the single command:
Set ColumnsToggle="scp:DoNotSync/Sync(3,37)"

DoNotSync.js.txt (1.18 KB)
Synchronisation:
Start and configure a DOpus sync between source and destination in the usual way. Then click 'Define' to the right of 'Filter' and select 'Name'='Script column', select 'Match'='NoMatch', select 'Sync' in the third column and 'No' in the fourth column.

Configuration:

  • By default, each file's 'Date Modified' is advanced by 1 minute so that the file will be synced. This can be changed at the top of the button-script: each file's 'Date Modified' can be set to now, or it can remain unchanged.
  • The default name of the hidden file is 'Sync.txt', and its default first line is 'No', but these may be changed if they are changed in both scripts.

Limitations:

  • Alternate data streams only work on Windows NTFS file systems, and cannot exist on Fat32. In particular, any USBs necessary for the sync should be formatted NTFS (although a one-way sync to a Fat32 USB will work OK).
  • A 'Permission denied' error occurs when trying to add a hidden file to some files, such as Windows Update Standalone Installer files.
  • Some software strips hidden files when saving. This can be changed in UEStudio, and there is probably a similar setting in Notepad++.
  • If a directory is involved in two or more such syncs and the unsystematic subsets are different, then the button-script and the script addin will need to be adapted. Perhaps takes copies of them renamed with 'Sync' replaced by 'SyncB', then in both scripts, change every occurrence of 'Sync' to SyncB'.

Use as an alternative 'Tag' system:
The two scripts do little more than provide yet another 'Tag' system for files. To use it like this, take renamed copies of the button-script and the script addin. Then in both scripts, change 'Sync' to whatever you want, and change 'No' to whatever you want.

Further development:
I may later extend the system to handle multiple syncs involving the same directories. This is easily done by treating the 1st, 2nd, 3rd, . . . lines of the hidden file 'Sync.txt' as entries in an array. But one sync is enough for now.

Warning:
Hidden files are used in Windows for all sorts of things, and should not normally be removed. Some operations with them are tricky. Tools for manipulating them can be found within Windows and at the sites mentioned in the DOpus URL given above, and also at the bottom of FlexHex.

This addin has now been replaced by the far more general addin ADSFilterAndTags.