{
    "content": [
        {
            "type": "text",
            "text": "# ntpdate(8) (man)\n\n**Summary:** ntpdate - set the date and time via NTP\n\n**Synopsis:** ntpdate [-46bBdqsuv] [-a key] [-e authdelay] [-k keyfile] [-o version] [-p samples] [-t time‐\nout] server [...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -4 | — | — | space. |\n| -6 | — | — | space. |\n| -a | — | — | thentication as the argument keyntpdate. The keys and key identifiers must match in both the client and server key files |\n| -B | — | — | sured offset is greater than +-500 ms. The default is to step the time using settime‐ ofday() if the offset is greater t |\n| -b | — | — | (default) using the adjtime() system call. This option should be used when called from a startup file at boot time. |\n| -d | — | — | just the local clock and using an unprivileged port. Information useful for general debugging will also be printed. |\n| -e | — | — | Specify the processing delay to perform an authentication function as the value au‐ thdelay, in seconds and fraction (se |\n| -k | — | — | Specify the path for the authentication key file as the string keyfile. The default is /etc/ntp.keys. This file should b |\n| -o | — | — | Specify the NTP version for outgoing packets as the integer version, which can be 1, 2, 3 or 4. The default is 4. This a |\n| -p | — | — | Specify the number of samples to be acquired from each server as the integer samples, with values from 1 to 8 inclusive. |\n| -q | — | — |  |\n| -s | — | — | ity. This is designed primarily for convenience of cron scripts. |\n| -t | — | — | Specify the maximum time waiting for a server response as the value timeout, in sec‐ onds and fraction. The value is is  |\n| -u | — | — | when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond t |\n| -v | — | — | logged. |\n\n## See Also\n\n- ntpdate-debian(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (30 lines)\n- **OPTIONS** (1 lines) — 15 subsections\n  - -4 (2 lines)\n  - -6 (2 lines)\n  - -a (4 lines)\n  - -B (6 lines)\n  - -b (3 lines)\n  - -d (3 lines)\n  - -e (5 lines)\n  - -k (3 lines)\n  - -o (3 lines)\n  - -p (3 lines)\n  - -q (1 lines)\n  - -s (2 lines)\n  - -t (4 lines)\n  - -u (4 lines)\n  - -v (2 lines)\n- **DIAGNOSTICS** (3 lines)\n- **FILES** (3 lines)\n- **BUGS** (4 lines)\n- **AUTHOR** (3 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\nntpdate - set the date and time via NTP\n\n### SYNOPSIS\n\nntpdate [-46bBdqsuv] [-a key] [-e authdelay] [-k keyfile] [-o version] [-p samples] [-t time‐\nout] server [...]\n\n### DESCRIPTION\n\nntpdate sets the local date and time by polling the Network  Time  Protocol  (NTP)  server(s)\ngiven  as  the  server arguments to determine the correct time. It must be run as root on the\nlocal host (unless the option -q is used). A number of samples are obtained from each of  the\nservers  specified  and a subset of the NTP clock filter and selection algorithms are applied\nto select the best of these. Note that the accuracy and reliability of ntpdate depends on the\nnumber of servers, the number of polls each time it is run and the interval between runs.\n\nntpdate  can  be  run  manually as necessary to set the host clock, or it can be run from the\nhost startup script to set the clock at boot time.  This is useful in some cases to  set  the\nclock  initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from\na cron script. However, it is important to note that ntpdate with contrived cron  scripts  is\nno  substitute  for  the NTP daemon, which uses sophisticated algorithms to maximize accuracy\nand reliability while minimizing resource use. Finally, since ntpdate does not discipline the\nhost clock frequency as does ntpd, the accuracy using ntpdate is limited.\n\nTime  adjustments  are made by ntpdate in one of two ways. If ntpdate determines the clock is\nin error more than 0.5 second it will simply step the time by calling the  system  settimeof‐\nday()  routine.  If  the error is less than 0.5 seconds, it will slew the time by calling the\nsystem adjtime() routine. The latter technique is less disruptive and more accurate when  the\nerror is small, and works quite well when ntpdate is run by cron every hour or two.\n\nntpdate will, if the -u flag was not specified, decline to set the date if an NTP server dae‐\nmon (e.g., ntpd) is running on the same host. When running ntpdate on a  regular  basis  from\ncron  as  an  alternative to running a daemon, doing so once every hour or two will result in\nprecise enough timekeeping to avoid stepping the clock.\n\nNote that in contexts where a host name is expected, a -4 qualifier preceding the  host  name\nforces  DNS  resolution  to the IPv4 namespace, while a -6 qualifier forces DNS resolution to\nthe IPv6 namespace.\n\n### OPTIONS\n\n#### -4\n\nspace.\n\n#### -6\n\nspace.\n\n#### -a\n\nthentication  as  the  argument keyntpdate. The keys and key identifiers must match in\nboth the client and server key files. The default is  to  disable  the  authentication\nfunction.\n\n#### -B\n\nsured offset is greater than +-500 ms. The default is to step the time using  settime‐\nofday()  if  the  offset  is  greater  than +-500 ms. Note that, if the offset is much\ngreater than +-500 ms in this case, that it can take a long time (hours) to  slew  the\nclock  to the correct value. During this time. the host should not be used to synchro‐\nnize clients.\n\n#### -b\n\n(default) using the adjtime() system call. This option should be used when called from\na startup file at boot time.\n\n#### -d\n\njust  the  local  clock and using an unprivileged port. Information useful for general\ndebugging will also be printed.\n\n#### -e\n\nSpecify the processing delay to perform an authentication function as  the  value  au‐\nthdelay,  in seconds and fraction (see ntpd for details). This number is usually small\nenough to be negligible for most purposes, though specifying a value may improve time‐\nkeeping on very slow CPU's.\n\n#### -k\n\nSpecify the path for the authentication key file as the string keyfile. The default is\n/etc/ntp.keys. This file should be in the format described in ntpd.\n\n#### -o\n\nSpecify the NTP version for outgoing packets as the integer version, which can  be  1,\n2, 3 or 4. The default is 4. This allows ntpdate to be used with older NTP versions.\n\n#### -p\n\nSpecify  the number of samples to be acquired from each server as the integer samples,\nwith values from 1 to 8 inclusive. The default is 4.\n\n#### -q\n\n#### -s\n\nity. This is designed primarily for convenience of cron scripts.\n\n#### -t\n\nSpecify  the  maximum time waiting for a server response as the value timeout, in sec‐\nonds and fraction. The value is is rounded to a multiple of 0.2 seconds.  The  default\nis 2 seconds, a value suitable for polling across a LAN.\n\n#### -u\n\nwhen behind a firewall that blocks incoming traffic to privileged ports, and you  want\nto synchronise with hosts beyond the firewall. Note that the -d option always uses un‐\nprivileged ports.\n\n#### -v\n\nlogged.\n\n### DIAGNOSTICS\n\nntpdate's  exit status is zero if it found a server and updates the clock, and nonzero other‐\nwise.\n\n### FILES\n\n/etc/ntp.keys\n- encryption keys used by ntpdate.\n\n### BUGS\n\nThe slew adjustment is actually 50% larger than the measured offset, since this  (it  is  ar‐\ngued)  will  tend  to  keep a badly drifting clock more accurate. This is probably not a good\nidea and may cause a troubling hunt for some values of the kernel variables tick and tickadj.\n\n### AUTHOR\n\nDavid L. Mills (mills@udel.edu)\nThis manpage converted from html to roff by Fabrizio Polacco <fpolacco@debian.org>\n\n### SEE ALSO\n\nntpdate-debian(8)\n\n\n\nntpdate(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "ntpdate",
        "section": "8",
        "mode": "man",
        "summary": "ntpdate - set the date and time via NTP",
        "synopsis": "ntpdate [-46bBdqsuv] [-a key] [-e authdelay] [-k keyfile] [-o version] [-p samples] [-t time‐\nout] server [...]",
        "flags": [
            {
                "flag": "-4",
                "long": null,
                "arg": null,
                "description": "space."
            },
            {
                "flag": "-6",
                "long": null,
                "arg": null,
                "description": "space."
            },
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": "thentication as the argument keyntpdate. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function."
            },
            {
                "flag": "-B",
                "long": null,
                "arg": null,
                "description": "sured offset is greater than +-500 ms. The default is to step the time using settime‐ ofday() if the offset is greater than +-500 ms. Note that, if the offset is much greater than +-500 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchro‐ nize clients."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "(default) using the adjtime() system call. This option should be used when called from a startup file at boot time."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "just the local clock and using an unprivileged port. Information useful for general debugging will also be printed."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "Specify the processing delay to perform an authentication function as the value au‐ thdelay, in seconds and fraction (see ntpd for details). This number is usually small enough to be negligible for most purposes, though specifying a value may improve time‐ keeping on very slow CPU's."
            },
            {
                "flag": "-k",
                "long": null,
                "arg": null,
                "description": "Specify the path for the authentication key file as the string keyfile. The default is /etc/ntp.keys. This file should be in the format described in ntpd."
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": "Specify the NTP version for outgoing packets as the integer version, which can be 1, 2, 3 or 4. The default is 4. This allows ntpdate to be used with older NTP versions."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "Specify the number of samples to be acquired from each server as the integer samples, with values from 1 to 8 inclusive. The default is 4."
            },
            {
                "flag": "-q",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "ity. This is designed primarily for convenience of cron scripts."
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": "Specify the maximum time waiting for a server response as the value timeout, in sec‐ onds and fraction. The value is is rounded to a multiple of 0.2 seconds. The default is 2 seconds, a value suitable for polling across a LAN."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses un‐ privileged ports."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": "logged."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "ntpdate-debian",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ntpdate-debian/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-4",
                        "lines": 2,
                        "flag": "-4"
                    },
                    {
                        "name": "-6",
                        "lines": 2,
                        "flag": "-6"
                    },
                    {
                        "name": "-a",
                        "lines": 4,
                        "flag": "-a"
                    },
                    {
                        "name": "-B",
                        "lines": 6,
                        "flag": "-B"
                    },
                    {
                        "name": "-b",
                        "lines": 3,
                        "flag": "-b"
                    },
                    {
                        "name": "-d",
                        "lines": 3,
                        "flag": "-d"
                    },
                    {
                        "name": "-e",
                        "lines": 5,
                        "flag": "-e"
                    },
                    {
                        "name": "-k",
                        "lines": 3,
                        "flag": "-k"
                    },
                    {
                        "name": "-o",
                        "lines": 3,
                        "flag": "-o"
                    },
                    {
                        "name": "-p",
                        "lines": 3,
                        "flag": "-p"
                    },
                    {
                        "name": "-q",
                        "lines": 1,
                        "flag": "-q"
                    },
                    {
                        "name": "-s",
                        "lines": 2,
                        "flag": "-s"
                    },
                    {
                        "name": "-t",
                        "lines": 4,
                        "flag": "-t"
                    },
                    {
                        "name": "-u",
                        "lines": 4,
                        "flag": "-u"
                    },
                    {
                        "name": "-v",
                        "lines": 2,
                        "flag": "-v"
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}