Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Deleting logs older than nnn days

From Tech-Wiki


Monitoring and operational reference for Deleting logs older than nnn days.

!
Review the impact before execution
This page contains commands or procedures that can remove data or materially change system state. Confirm the target, change plan and recovery path before use.

In order to avoid running out of disk space, you can set to delete log files older than one year (you can adjust this value below) just edit your crontab and add:

0 0 1 1 *   find $FWDIR/log/ -mtime +365 -exec rm -f {} \;

This way, on January 1st, it will delete the files from the previous year (not the one that has just ended :)

See also

Contents