The process responsible for synchronizing the database with the file system is called syncvoltodb(8). That process can be called by hand or by another program, such as
userperms or
dblogd(8). In all of these cases, the
sync can be run with or without
-delnorm option.
Never use the -del flag with
syncvoltodb(8) for it can be destructive. Always use
-delnorm instead. However, as you have seen earlier, you can safely use a
-del flag with
userperms. In that instance,
-del performs with
userperms exactly as
-delnorm performs with
syncvoltodb(8).
A sync happens on a directory-by-directory basis. The idea is to get the database’s information on the folder’s contents to agree with what’s on the file system, and to do it as quickly as possible. Roughly, here is the procedure for each directory:
The -delnorm flag sets files to Online=3, but not offline—they still show online to people browsing. If there are subfolders, they are turned off one at a time in a recursive sync to copy paths down the file system tree.
Setting files off ensures that the
syncvoltodb(8) will synchronize every file in the folder without exception. There should be nothing different between the database and the file system after a
-delnorm sync.
A sync run without a -
del or
-delnorm simply uses the procedure outlined in the
"Default behavior” on page 682.
This type of sync is designed to catch changes made to the file system that evaded
dblogd(8), and to do it quickly.
Syncs run without a
-delnorm flag have one big flaw, known as the “cover-up” case. Normally, any change made to the file system (via SMB, NFS, or Unix) will cause a modification time discrepancy for the folder, thus setting up this directory to be synchronized when a
sync is run. However, the modification time discrepancy can be covered up. Consider this scenario:
So whatever files where added at 4 pm via Unix or SMB will not be added to the database when the sync happens. The only option is to run a
syncvoltodb -delnorm on that directory (or a directory above it). As you can see, this adds an element of chance as to whether files will be caught by the sync or not.