SYNC(8)                 FreeBSD System Manager's Manual                SYNC(8)

NAME

     sync - force completion of pending disk writes (flush cache)

SYNOPSIS

     sync

DESCRIPTION

     The sync utility can be called to ensure that all disk writes have been
     completed before the processor is halted in a way not suitably done by
     reboot(8) or halt(8).  Generally, it is preferable to use reboot(8) or
     halt(8) to shut down the system, as they may perform additional actions
     such as resynchronizing the hardware clock and flushing internal caches
     before performing a final sync.

     The sync utility utilizes the sync(2) function call.

SEE ALSO

     fsync(2), sync(2), syncer(4), halt(8), reboot(8)

HISTORY

     A sync utility appeared in Version 4 AT&T UNIX.

     On systems older than 4.0BSD, commands like reboot(8) and halt(8) were
     unavailable.  The shutdown procedure involved running sync, waiting for
     the lights to stop, and turning off the machine.

     Issuing three separate sync commands (one line each) was a placebo that
     would generally suffice in Version 7 AT&T UNIX machines that were
     otherwise quiesced systems.  It replaced the one-per-line sync as a
     substitute for waiting.

     4.0BSD introduced reboot(2) and sync(2) which rendered this trick
     obsolete.

FreeBSD 15.1-STABLE-HBSD        April 25, 2024                         SYNC(8)