%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%80%8D%E3%82%92%E6%B6%88%E5%8E%BB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%20-%20Debian.png)
Debian 6にはPythonにリンクされた大きなファイルがあります
/tmp/tmpLwS5ny.tbuf (deleted)
/tmp/tmpMjH6hy.tbuf (deleted)
/tmp/tmpGtY5dz.tbuf (deleted)
サーバーを再起動したくないのですが、削除したほうがよいでしょうか? どうすればいいでしょうか?
答え1
このスクリプトをcronジョブとして追加すると、再起動せずにファイルを削除できます。
#!/bin/sh
# Clean file and dirs more than 3 days old in /tmp nightly
/usr/bin/find /tmp -type f -atime +2 -mtime +2 |xargs /bin/rm -f &&
/usr/bin/find /tmp -type d -mtime +2 -exec /bin/rm -rf '{}' \; &&
/usr/bin/find /tmp -type l -ctime +2 |xargs /bin/rm -f &&
/usr/bin/find -L /tmp -mtime +2 -print -exec rm -f {} \;
上記の内容をファイルに保存し、そのファイルをchmod 775で実行するためのcronエントリを作成します。