{"id":2763,"date":"2022-12-20T15:17:13","date_gmt":"2022-12-20T18:17:13","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tmpwatch-man8\/"},"modified":"2022-12-20T15:17:13","modified_gmt":"2022-12-20T18:17:13","slug":"tmpwatch-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tmpwatch-man8\/","title":{"rendered":"TMPWATCH (man8)"},"content":{"rendered":"<h1 align=\"center\">TMPWATCH<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">tmpwatch \u2212 removes files which haven\u2019t been accessed for a period of time<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tmpwatch<\/b> [-u|-m|-c] [-MUXadfqstvx] [&#8211;verbose] [&#8211;force] [&#8211;all] <br \/> [&#8211;nodirs] [&#8211;nosymlinks] [&#8211;test] [&#8211;fuser] [&#8211;quiet] <br \/> [&#8211;atime|&#8211;mtime|&#8211;ctime] [&#8211;dirmtime] [&#8211;exclude <i>path<\/i>] <br \/> [&#8211;exclude-user <i>user<\/i>] [&#8211;exclude-pattern <i>pattern<\/i>] <i><br \/> time dirs<\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>tmpwatch<\/b><\/i> recursively removes files which haven\u2019t been accessed for a given time. Normally, it\u2019s used to clean up directories which are used for temporary holding space such as \/tmp.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When changing directories, <b>tmpwatch<\/b> is very sensitive to possible race conditions and will exit with an error if one is detected. It does not follow symbolic links in the directories it\u2019s cleaning (even if a symbolic link is given as its argument), does not switch filesystems (including non-trivial bind mounts), skips <i>lost+found<\/i> directories owned by the root user, and only removes empty directories, regular files, symbolic links, and on some systems also unused sockets.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">By default, <b>tmpwatch<\/b> dates files by their atime (access time), not their mtime (modification time). If files aren\u2019t being removed when <b>ls -l<\/b> implies they should be, use <b>ls -u<\/b> to examine their atime to see if that explains the problem.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the -\u2212atime, -\u2212ctime or -\u2212mtime options are used in combination, the decision about deleting a file will be based on the maximum of these times. The -\u2212dirmtime option implies ignoring atime of directories, even if the -\u2212atime option is used.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>time<\/i> parameter defines the threshold for removing files. If the file has not been accessed for <i>time<\/i>, the file is removed. The <i>time<\/i> argument is a number with an optional single-character suffix specifying the units: <b>m<\/b> for minutes, <b>h<\/b> for hours, <b>d<\/b> for days. If no suffix is specified, <i>time<\/i> is in hours.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Following this, one or more directories may be given for <b>tmpwatch<\/b> to clean up.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>-u, -\u2212atime<\/b><\/p>\n<p style=\"margin-left:22%;\">Make the decision about deleting a file based on the file\u2019s atime (access time). This is the default.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">Note that the periodic <b>updatedb<\/b> file system scans keep the atime of directories recent.<\/p>\n<p style=\"margin-left:11%;\"><b>-m, -\u2212mtime<\/b><\/p>\n<p style=\"margin-left:22%;\">Make the decision about deleting a file based on the file\u2019s mtime (modification time) instead of the atime.<\/p>\n<p style=\"margin-left:11%;\"><b>-c, -\u2212ctime<\/b><\/p>\n<p style=\"margin-left:22%;\">Make the decision about deleting a file based on the file\u2019s ctime (inode change time) instead of the atime; for directories, make the decision based on the mtime.<\/p>\n<p style=\"margin-left:11%;\"><b>-M, -\u2212dirmtime<\/b><\/p>\n<p style=\"margin-left:22%;\">Make the decision about deleting a directory based on the directory\u2019s mtime (modification time) instead of the atime; completely ignore atime for directories.<\/p>\n<p style=\"margin-left:11%;\"><b>-a, -\u2212all<\/b><\/p>\n<p style=\"margin-left:22%;\">Remove all file types, not just regular files, symbolic links and directories. On systems where <b>tmpwatch<\/b> can remove unused sockets, make the decision only based on file times, ignoring possible use of the socket.<\/p>\n<p style=\"margin-left:11%;\"><b>-d, -\u2212nodirs<\/b><\/p>\n<p style=\"margin-left:22%;\">Do not attempt to remove directories, even if they are empty.<\/p>\n<p style=\"margin-left:11%;\"><b>-f, -\u2212force<\/b><\/p>\n<p style=\"margin-left:22%;\">Remove root-owned files even if root doesn\u2019t have write access (akin to <b>rm -f<\/b>).<\/p>\n<p style=\"margin-left:11%;\"><b>-l, -\u2212nosymlinks<\/b><\/p>\n<p style=\"margin-left:22%;\">Do not attempt to remove symbolic links.<\/p>\n<p style=\"margin-left:11%;\"><b>-q, -\u2212quiet<\/b><\/p>\n<p style=\"margin-left:22%;\">Report only fatal errors.<\/p>\n<p style=\"margin-left:11%;\"><b>-s, -\u2212fuser<\/b><\/p>\n<p style=\"margin-left:22%;\">Attempt to use the &#8220;fuser&#8221; command to see if a file is already open before removing it. Not enabled by default. Does help in some circumstances, but not all. Dependent on fuser being installed in \/sbin. Not supported on HP-UX or Solaris.<\/p>\n<p style=\"margin-left:11%;\"><b>-t, -\u2212test<\/b><\/p>\n<p style=\"margin-left:22%;\">Don\u2019t remove files, but go through the motions of removing them. This implies <b>\u2212v<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>-U, -\u2212exclude-user=<\/b><i>user<\/i><\/p>\n<p style=\"margin-left:22%;\">Don\u2019t remove files owned by <i>user<\/i>, which can be an user name or numeric user ID.<\/p>\n<p style=\"margin-left:11%;\"><b>-v, -\u2212verbose<\/b><\/p>\n<p style=\"margin-left:22%;\">Print a verbose display. Two levels of verboseness are available &#8212; use this option twice to get the most verbose output.<\/p>\n<p style=\"margin-left:11%;\"><b>-x, -\u2212exclude=<\/b><i>path<\/i><\/p>\n<p style=\"margin-left:22%;\">Skip <i>path<\/i>; if <i>path<\/i> is a directory, all files contained in it are skipped too. If <i>path<\/i> does not exist, it must be an absolute path that contains no symbolic links.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212X<\/b>, <b>\u2212\u2212exclude\u2212pattern=<\/b><i>pattern<\/i><\/p>\n<p style=\"margin-left:22%;\">Skip paths matching <i>pattern<\/i>; if a directory matches <i>pattern<\/i>, all files contained in it are skipped too. <i>pattern<\/i> must match an absolute path that contains no symbolic links.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>cron<\/i>(1), <i>ls<\/i>(1), <i>rm<\/i>(1), <i>fuser<\/i>(1)<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Erik Troan <ewt@redhat.com> <br \/> Preston Brown <pbrown@redhat.com> Nalin Dahyabhai <nalin@redhat.com> <br \/> Miloslav Trmac <mitr@redhat.com><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  tmpwatch \u2212 removes files which haven\u2019t been accessed for a period of time <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,117],"class_list":["post-2763","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tmpwatch"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=2763"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2763\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}