Skip to content

Instantly share code, notes, and snippets.

@seyerj
Created November 23, 2021 19:07
Show Gist options
  • Save seyerj/b7f4b54f91bd92b84048737722e0a930 to your computer and use it in GitHub Desktop.
Save seyerj/b7f4b54f91bd92b84048737722e0a930 to your computer and use it in GitHub Desktop.
truncates target file (/opt/librenms/logs/librenms.log) to last 500 lines
echo "$(tail -n 500 /opt/librenms/logs/librenms.log)" > /opt/librenms/logs/librenms.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment