2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxでcrontabのファイルに定期的にディレクトリを削除するためのコマンドを書く

Last updated at Posted at 2019-04-27

今回初めて投稿致します。先日会社でLinuxの特定のディレクトリを定期的に削除するためにcrontabのファイルを編集したので書き残して置こうと思います。

0 1 * * * find /usr/test/ -type d -mtime +0 | xargs rm -rf

このコマンドは、生成されてから24時間以上経過したディレクトリを毎日午前1時頃に削除するものです。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?