{
    "content": [
        {
            "type": "text",
            "text": "# savelog (man)\n\n## NAME\n\nsavelog - save a log file\n\n## SYNOPSIS\n\nsavelog  [-m  mode]  [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C]\n[-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat] file ...\n\n## DESCRIPTION\n\nThe savelog command saves and optionally compresses old copies of files.  Older  versions  of\nfile are named:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (16 subsections)\n- **BUGS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "savelog",
        "section": "",
        "mode": "man",
        "summary": "savelog - save a log file",
        "synopsis": "savelog  [-m  mode]  [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C]\n[-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat] file ...",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "chmod the log files to mode, implies -t"
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "chown log files to user, implies -t"
            },
            {
                "flag": "-g",
                "long": null,
                "arg": null,
                "description": "chgrp log files to group, implies -t"
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "Save cycle versions of the logfile (default: 7). The cycle count must be at least 2."
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-l",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-j",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-J",
                "long": null,
                "arg": null,
                "description": "For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a very large amount of memory for the higher compression levels."
            },
            {
                "flag": "-9",
                "long": null,
                "arg": null,
                "description": "compression strength or memory usage (default: 9, except for xz)"
            },
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-D",
                "long": null,
                "arg": null,
                "description": "override date format, in the syntax understood by the date(1) command"
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-q",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "logrotate",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/logrotate/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-m mode",
                        "lines": 2,
                        "flag": "-m"
                    },
                    {
                        "name": "-u user",
                        "lines": 2,
                        "flag": "-u"
                    },
                    {
                        "name": "-g group",
                        "lines": 2,
                        "flag": "-g"
                    },
                    {
                        "name": "-c cycle",
                        "lines": 2,
                        "flag": "-c"
                    },
                    {
                        "name": "-t",
                        "lines": 1,
                        "flag": "-t"
                    },
                    {
                        "name": "-l",
                        "lines": 1,
                        "flag": "-l"
                    },
                    {
                        "name": "-p",
                        "lines": 1,
                        "flag": "-p"
                    },
                    {
                        "name": "-j",
                        "lines": 1,
                        "flag": "-j"
                    },
                    {
                        "name": "-J",
                        "lines": 4,
                        "flag": "-J"
                    },
                    {
                        "name": "-1 .. -9",
                        "lines": 2,
                        "flag": "-9"
                    },
                    {
                        "name": "-C",
                        "lines": 1,
                        "flag": "-C"
                    },
                    {
                        "name": "-d",
                        "lines": 1,
                        "flag": "-d"
                    },
                    {
                        "name": "-D dateformat",
                        "lines": 2,
                        "flag": "-D"
                    },
                    {
                        "name": "-r",
                        "lines": 1,
                        "flag": "-r"
                    },
                    {
                        "name": "-n",
                        "lines": 1,
                        "flag": "-n"
                    },
                    {
                        "name": "-q",
                        "lines": 1,
                        "flag": "-q"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "savelog - save a log file\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "savelog  [-m  mode]  [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C]\n[-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat] file ...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The savelog command saves and optionally compresses old copies of files.  Older  versions  of\nfile are named:\n\nfile.<number><compresssuffix>\n\nwhere <number> is the version number, 0 being the newest.  Version numbers > 0 are compressed\nunless -l prevents it.  Version number 0 is not compressed because a process might still have\nfile opened for I/O.  Only cycle versions of the file are kept.\n\nIf the file does not exist and -t was given, it will be created.\n\nFor  files  that  do exist and have lengths greater than zero, the following actions are per‐\nformed:\n\n\n1)     Version numbered files are cycled.  Version file.2 is moved to version file.3, version\nfile.1 is moved to version file.2, and so on.  Finally version file.0 is moved to ver‐\nsion file.1, and version file is deleted.   Both  compressed  names  and  uncompressed\nnames are cycled, regardless of -l.  Missing version files are ignored.\n\n2)     The  new  file.1 is compressed unless the -l flag was given.  It is changed subject to\nthe -m, -u, and -g flags.\n\n3)     The main file is moved to file.0.\n\n4)     If the -m, -u, -g,  -t, or -p flags are given, then an empty file is  created  subject\nto the given flags.  With the -p flag, the file is created with the same owner, group,\nand permissions as before.\n\n5)     The new file.0 is changed subject to the -m, -u, and -g flags.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-m mode",
                        "content": "chmod the log files to mode, implies -t\n",
                        "flag": "-m"
                    },
                    {
                        "name": "-u user",
                        "content": "chown log files to user, implies -t\n",
                        "flag": "-u"
                    },
                    {
                        "name": "-g group",
                        "content": "chgrp log files to group, implies -t\n",
                        "flag": "-g"
                    },
                    {
                        "name": "-c cycle",
                        "content": "Save cycle versions of the logfile (default: 7).  The cycle count must be at least 2.\n",
                        "flag": "-c"
                    },
                    {
                        "name": "-t",
                        "content": "",
                        "flag": "-t"
                    },
                    {
                        "name": "-l",
                        "content": "",
                        "flag": "-l"
                    },
                    {
                        "name": "-p",
                        "content": "",
                        "flag": "-p"
                    },
                    {
                        "name": "-j",
                        "content": "",
                        "flag": "-j"
                    },
                    {
                        "name": "-J",
                        "content": "For xz no strength option is set, and xz decides on the default  based  on  the  total\namount  of  physical  RAM.  Note that xz can use a very large amount of memory for the\nhigher compression levels.\n",
                        "flag": "-J"
                    },
                    {
                        "name": "-1 .. -9",
                        "content": "compression strength or memory usage (default: 9, except for xz)\n",
                        "flag": "-9"
                    },
                    {
                        "name": "-C",
                        "content": "",
                        "flag": "-C"
                    },
                    {
                        "name": "-d",
                        "content": "",
                        "flag": "-d"
                    },
                    {
                        "name": "-D dateformat",
                        "content": "override date format, in the syntax understood by the date(1) command\n",
                        "flag": "-D"
                    },
                    {
                        "name": "-r",
                        "content": "",
                        "flag": "-r"
                    },
                    {
                        "name": "-n",
                        "content": "",
                        "flag": "-n"
                    },
                    {
                        "name": "-q",
                        "content": "",
                        "flag": "-q"
                    }
                ]
            },
            "BUGS": {
                "content": "If a process is still writing to file.0, and savelog moves it to file.1  and  compresses  it,\ndata could be lost.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "logrotate(8)\n\n\n\nDebian                                       30 Dec 2017                                  SAVELOG(8)",
                "subsections": []
            }
        }
    }
}