Видалення тимчасових файлів tmpwatch

Матеріал з Wiki TNEU
Перейти до: навігація, пошук

Linux / Unix Command: tmpwatch Linux / Unix Команда: tmpwatch

Command Library Командна бібліотека  

NAME НАЗВА tmpwatch - removes files which haven't been accessed for a period of time tmpwatch - видаляє файли, які не зверталися протягом певного періоду часу SYNOPSIS СИНТАКСИС tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all] [--test] tmpwatch [-і | м |-C] [-faqstv] [- детальний] [- сила] [- все] [- тест] [--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours> <dirs> [- Пічки] [- atime | - MTime | - CTime] [- тихий] <hours> <dirs>


DESCRIPTION ОПИС tmpwatch recursively removes files which haven't been accessed for a given number of hours. tmpwatch рекурсивно видаляє файли, які не зверталися протягом заданого числа годин. Normally, it's used to clean up directories which are used for temporary holding space such as /tmp. Як правило, він використовується для очищення каталогів, які використовуються для тимчасового утримання просторі, наприклад, / TMP. When changing directories, tmpwatch is very sensitive to possible race conditions and will exit with an error if one is detected. При переході в каталог, tmpwatch дуже чутливий до можливих умов гонки і вийде з помилкою, якщо він виявлений. It does not follow symbolic links in the directories it's cleaning (even if a symbolic link is given as its argument), will not switch filesystems, З цього не випливає символічні посилання в каталогах, це прибирання (навіть якщо символьне посилання дається як аргумент), не включається файлових систем, and only removes empty directories and regular files. і тільки видаляє порожні каталоги і звичайні файли.

By default, tmpwatch dates files by their atime (access time), not their mtime (modification time). За замовчуванням, tmpwatch дат файли по atime (час доступу), а не їх MTime (час модифікації). If files aren't being removed when ls -l implies they should be, use ls -u to examine their atime to see if that explains the problem. Якщо файли не видаляються при LS-л означає, вони повинні бути, використовувати LS-U, щоб вивчити їх atime, щоб переконатися, що пояснює проблеми.

If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of this times. Якщо - atime, - CTime або - MTime опції використовуються в комбінації, рішення про видалення файлів буде заснований на максимум цього часу.

The hours parameter defines the threshold for removing files. Години параметр визначає поріг для видалення файлів. If the file has not been accessed for hours hours, the file is removed. Якщо файл не був доступний протягом декількох годин годин, файл видаляється. Following this, one or more directories may be given for tmpwatch to clean up. Після цього, один або декілька каталогів можуть бути передані на tmpwatch, щоб вимитися.



OPTIONS ВАРІАНТИ -u, --atime -І, - atime Make the decision about deleting a file based on the file's atime (access time). Прийміть рішення про видалення файлу на основі atime файлу (час доступу). This is the default. Це значення за замовчуванням.


-m, --mtime М, - MTime Make the decision about deleting a file based on the file's mtime (modification time) instead of the atime. Прийміть рішення про видалення файлу на основі MTime файлу (час зміни) замість atime.

-c, --ctime -С, - CTime Make the decision about deleting a file based on the file's ctime (inode change time) instead of the atime; for directories, make the decision based on the mtime. Прийміть рішення про видалення файлу на основі CTime файлу (індексний дескриптор зміна часу) замість atime; для каталогів, приймати рішення на основі MTime.

-a, --all -А, - все Remove all file types, not just regular files and directories. Видаліть всі типи файлів, а не тільки звичайні файли і каталоги.

-d, --nodirs -D, - nodirs Do not attempt to remove directories, even if they are empty. Не намагайтеся видалити каталоги, навіть якщо вони порожні.

-f, --force -F, - сили Remove files even if root doesn't have write access (akin to rm -f ). Видалити файли, навіть якщо корінь не мати права на запис (те саме RM-е).

-t, --test -Т, - тест Doesn't remove files, but goes through the motions of removing them. Не видаляє файли, але проходить через рухи їх усунення. This implies -v . Це означає,-V.

-s, --fuser -С, - грубки Attempt to use the "fuser" 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. Залежно від грубки бути встановлений в / sbin.

-v, --verbose -V, - детальний Print a verbose display. Друк дисплей багатослівним. Two levels of verboseness are available -- use this option twice to get the most verbose output. Два рівня рівня подробиці доступні - використовуйте цю опцію двічі, щоб отримати найбільш детальний висновок.

Видалення:



Author: baggins Date: Thu Mar 31 12:34:44 2011 GMT Module: packages Tag: HEAD


Log message:

- rel 2 - -x won't match *, RTFM


Files affected:

packages/tmpwatch:

  tmpwatch.spec (1.87 -> 1.88) 

Diffs:
====================================================

Index: packages/tmpwatch/tmpwatch.spec diff -u packages/tmpwatch/tmpwatch.spec:1.87 packages/tmpwatch/tmpwatch.spec:1.88 --- packages/tmpwatch/tmpwatch.spec:1.87 Sat Jan 29 01:07:28 2011 +++ packages/tmpwatch/tmpwatch.spec Thu Mar 31 14:34:39 2011 @@ -12,7 +12,7 @@

Summary(uk.UTF-8):     Утиліта видалення файлів за критерієм давності 

останнього доступу

Name:          tmpwatch
Version:       2.10.1

-Release: 1 +Release: 2

License:       GPL v2
Group:         Applications/System
Source0:       

https://fedorahosted.org/releases/t/m/tmpwatch/%{name}-%{version}.tar.bz2 @@ -115,7 +115,7 @@

fi

%{_sbindir}/tmpwatch ${OPTIONS} -x /tmp/.X11-unix -x /tmp/.XIM-unix -x 

/tmp/.font-unix \ --x /tmp/.ICE-unix -x /tmp/.Test-unix -x /tmp/.s.PGSQL.\* 240 /tmp +-x /tmp/.ICE-unix -x /tmp/.Test-unix -X /tmp/.s.PGSQL.\* 240 /tmp

# Cleanup amavis quarantine:
if [ -d /var/spool/amavis/virusmails ]; then

@@ -157,6 +157,10 @@

All persons listed below can be reached at <cvs_login>@pld-linux.org

$Log$

+Revision 1.88 2011/03/31 12:34:39 baggins +- rel 2 +- -x won't match *, RTFM +

Revision 1.87  2011/01/29 00:07:28  sparky
- dropped pre-cvs changelog

====================================================
Особисті інструменти
Простори назв

Варіанти
Дії
Навігація
Інструменти