Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created March 31, 2016 03:59
Show Gist options
  • Save kurozumi/5fbd61140cab111c3ec008098dc665bb to your computer and use it in GitHub Desktop.
Save kurozumi/5fbd61140cab111c3ec008098dc665bb to your computer and use it in GitHub Desktop.
crontabにtmpwatchを登録して/tmpディレクトリの更新日時やアクセス時刻が一時間以上経った古いファイルを削除する方法
# tmpwatch
* * * * * /usr/sbin/tmpwatch -umc -x /tmp/.X11-unix -x /tmp/.XIM-unix -x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix -X '/tmp/hsperfdata_*' -X '/tmp/.hdb*lock' -X '/tmp/.sapstartsrv*.log' 1 /tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment