{
    "content": [
        {
            "type": "text",
            "text": "# SG_SYNC (man)\n\n## NAME\n\nsgsync - send SCSI SYNCHRONIZE CACHE command\n\n## SYNOPSIS\n\nsgsync  [--16]  [--count=COUNT]  [--group=GN]  [--help]  [--immed]  [--lba=LBA]  [--sync-nv]\n[--timeout=SECS] [--verbose] [--version] DEVICE\n\n## DESCRIPTION\n\nSend SYNCHRONIZE CACHE(10) or SYNCHRONIZE CACHE(16) command to DEVICE.   These  commands  are\ndefined  for  SCSI block devices (see SBC-3). If successful these commands make sure that any\nblocks whose latest versions are held in cache are written to (also termed  as  \"synchronized\nwith\") the medium.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (10 subsections)\n- **NOTES**\n- **EXIT STATUS**\n- **AUTHORS**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SG_SYNC",
        "section": "",
        "mode": "man",
        "summary": "sgsync - send SCSI SYNCHRONIZE CACHE command",
        "synopsis": "sgsync  [--16]  [--count=COUNT]  [--group=GN]  [--help]  [--immed]  [--lba=LBA]  [--sync-nv]\n[--timeout=SECS] [--verbose] [--version] DEVICE",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-S",
                "long": "--16",
                "arg": null,
                "description": "performs a SYNCHRONIZE CACHE(16) command. Default is to perform a SYNCHRONIZE CACHE(10) command."
            },
            {
                "flag": "-c",
                "long": "--count",
                "arg": null,
                "description": "where COUNT is the number of blocks to synchronize from and including LBA. Default value is 0. When 0 then all blocks in the cache from and including LBA argument to the highest block address are synchronized."
            },
            {
                "flag": "-g",
                "long": "--group",
                "arg": null,
                "description": "where GN is the group number which can be between 0 and 63 inclusive. The default value is 0 . Group numbers are used to segregate data collected within the device. This is a new feature in SBC-2 and can probably be ignored for the time being."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "output the usage message then exit."
            },
            {
                "flag": "-i",
                "long": "--immed",
                "arg": null,
                "description": "sets the IMMED bit in the SYNCHRONIZE CACHE command. This instructs the device, if the format of the command is acceptable, to return a GOOD status immediately rather than wait for the blocks in the cache to be synchronized with (i.e. written to) the medium."
            },
            {
                "flag": "-l",
                "long": "--lba",
                "arg": null,
                "description": "where LBA is the lowest logical block address in the cache to synchronize to the medium. Default value is 0 ."
            },
            {
                "flag": "-s",
                "long": "--sync-nv",
                "arg": null,
                "description": "synchronize the (volatile) cache with the non-volatile cache. Without this option (or if there is no non-volatile cache in the device) the synchronization is with the medium. The SYNCNV bit was made obsolete in SBC-3 revision 35d."
            },
            {
                "flag": "-t",
                "long": "--timeout",
                "arg": null,
                "description": "where SECS is the number of seconds the OS allows the SYNCHRONIZE CACHE(16) to com‐ plete before it tries to cancel the command. Cancelling commands (typically with the task management function \"abort task\") is best avoided. Note this option is only ac‐ tive together with the --16 option. The default timeout is 60 seconds for both SYN‐ CHRONIZE CACHE(10) and SYNCHRONIZE CACHE(16). Note that timeout issues can be avoided with the --immed option."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "increase the level of verbosity, (i.e. debug output)."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "print the version string and then exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "sgstart",
                "section": "sg3utils",
                "url": "https://www.chedong.com/phpMan.php/man/sgstart/sg3utils/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-S --16",
                        "lines": 3,
                        "flag": "-S",
                        "long": "--16"
                    },
                    {
                        "name": "-c --count",
                        "lines": 4,
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "-g --group",
                        "lines": 4,
                        "flag": "-g",
                        "long": "--group"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-i --immed",
                        "lines": 4,
                        "flag": "-i",
                        "long": "--immed"
                    },
                    {
                        "name": "-l --lba",
                        "lines": 3,
                        "flag": "-l",
                        "long": "--lba"
                    },
                    {
                        "name": "-s --sync-nv",
                        "lines": 4,
                        "flag": "-s",
                        "long": "--sync-nv"
                    },
                    {
                        "name": "-t --timeout",
                        "lines": 7,
                        "flag": "-t",
                        "long": "--timeout"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "sgsync - send SCSI SYNCHRONIZE CACHE command\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "sgsync  [--16]  [--count=COUNT]  [--group=GN]  [--help]  [--immed]  [--lba=LBA]  [--sync-nv]\n[--timeout=SECS] [--verbose] [--version] DEVICE\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Send SYNCHRONIZE CACHE(10) or SYNCHRONIZE CACHE(16) command to DEVICE.   These  commands  are\ndefined  for  SCSI block devices (see SBC-3). If successful these commands make sure that any\nblocks whose latest versions are held in cache are written to (also termed  as  \"synchronized\nwith\") the medium.\n\nIf  the  LBA  and COUNT arguments are both zero (their defaults) then all blocks in the cache\nare synchronized. If LBA is greater than zero while COUNT is zero then blocks  in  the  cache\nwhose addresses are from and including LBA to the highest lba on the device are synchronized.\nIf both LBA and COUNT are non zero then blocks in the cache whose addresses lie in the  range\nLBA to LBA+COUNT-1 inclusive are synchronized with the medium.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Arguments to long options are mandatory for short options as well.\n",
                "subsections": [
                    {
                        "name": "-S --16",
                        "content": "performs  a  SYNCHRONIZE  CACHE(16)  command.  Default  is  to  perform  a SYNCHRONIZE\nCACHE(10) command.\n",
                        "flag": "-S",
                        "long": "--16"
                    },
                    {
                        "name": "-c --count",
                        "content": "where COUNT is the number of blocks to synchronize from  and  including  LBA.  Default\nvalue is 0. When 0 then all blocks in the cache from and including LBA argument to the\nhighest block address are synchronized.\n",
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "-g --group",
                        "content": "where GN is the group number which can be between 0 and  63  inclusive.   The  default\nvalue  is  0  .  Group numbers are used to segregate data collected within the device.\nThis is a new feature in SBC-2 and can probably be ignored for the time being.\n",
                        "flag": "-g",
                        "long": "--group"
                    },
                    {
                        "name": "-h --help",
                        "content": "output the usage message then exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-i --immed",
                        "content": "sets the IMMED bit in the SYNCHRONIZE CACHE command. This instructs the device, if the\nformat  of  the command is acceptable, to return a GOOD status immediately rather than\nwait for the blocks in the cache to be synchronized with (i.e. written to) the medium.\n",
                        "flag": "-i",
                        "long": "--immed"
                    },
                    {
                        "name": "-l --lba",
                        "content": "where LBA is the lowest logical block address in  the  cache  to  synchronize  to  the\nmedium. Default value is 0 .\n",
                        "flag": "-l",
                        "long": "--lba"
                    },
                    {
                        "name": "-s --sync-nv",
                        "content": "synchronize  the (volatile) cache with the non-volatile cache. Without this option (or\nif there is no non-volatile cache in the  device)  the  synchronization  is  with  the\nmedium. The SYNCNV bit was made obsolete in SBC-3 revision 35d.\n",
                        "flag": "-s",
                        "long": "--sync-nv"
                    },
                    {
                        "name": "-t --timeout",
                        "content": "where  SECS  is  the number of seconds the OS allows the SYNCHRONIZE CACHE(16) to com‐\nplete before it tries to cancel the command. Cancelling commands (typically  with  the\ntask  management  function \"abort task\") is best avoided. Note this option is only ac‐\ntive together with the --16 option. The default timeout is 60 seconds  for  both  SYN‐\nCHRONIZE  CACHE(10) and SYNCHRONIZE CACHE(16). Note that timeout issues can be avoided\nwith the --immed option.\n",
                        "flag": "-t",
                        "long": "--timeout"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "increase the level of verbosity, (i.e. debug output).\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "content": "print the version string and then exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "NOTES": {
                "content": "With the SYNCHRONIZE CACHE(16) command LBA can be up to 64 bits in size and COUNT  up  to  32\nbits  in  size.  With  the  SYNCHRONIZ CACHE(10) command LBA can be up to 32 bits in size and\nCOUNT up to 16 bits in size.\n\nVarious numeric arguments (e.g. LBA) may include multiplicative suffixes or be given in hexa‐\ndecimal. See the \"NUMERIC ARGUMENTS\" section in the sg3utils(8) man page.\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "The  exit  status  of  sgsync is 0 when it is successful. Otherwise see the sg3utils(8) man\npage.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Written by Douglas Gilbert.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "Report bugs to <dgilbert at interlog dot com>.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2004-2018 Douglas Gilbert\nThis software is distributed under a FreeBSD license. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "sgstart(sg3utils)\n\n\n\nsg3utils-1.43                                May 2018                                    SGSYNC(8)",
                "subsections": []
            }
        }
    }
}