首页
首页 » 文件管理 » tmpwatch(temporary watch)

tmpwatch(temporary watch)

tmpwatch(temporary watch)
功能说明:删除暂存文件。
语  法:tmpwatch [-afqv][--test][超期时间][目录...]
补充说明:执行tmpwatch指令可删除不必要的暂存文件,您可以设置文件超期时间,单位以小时计算。
参  数:
 -a或--all  删除任何类型的文件。 
 -f或--force  强制删除文件或目录,其效果类似rm指令的"-f"参数。 
 -q或--quiet  不显示指令执行过程。 
 -v或--verbose  详细显示指令执行过程。 
 -test  仅作测试,并不真的删除文件或目录。

tmpwatch

tmpwatch [options] hours directory

System administration command. Recursively remove regular files and directories in directory with access times older than hours. Specify the directory as an absolute path. This command is usually invoked by cron to remove old files in the /tmp directory.

Options

-a, --all

Remove all file types.

-c, --ctime

Make decision on last inode change time for files and modification time for directories instead of access time

-d, --nodirs

Do not remove directories.

-f, --force

Force removal of read-only files (similar to rm -f).

-m, --mtime

Make decision on last modification time instead of access time.

-s, --fuser

Before deleting, attempt to use fuser to see if a file is in use.

-t, --test

Verbosely test command, but don't actually remove files.

-u, --atime

Make decision on access time. (This is the default.)

-v, --verbose

Print more details. Use two times to further increase the detail of the output.

-x, --exclude=path

Skip the specified path, the absolute path of a directory or file.