User Tools

Site Tools


bash:files:cleaning_log_files

BASH - Files - Cleaning Log Files

Deletes all log files present inside your /var/log directory.

#!/bin/bash
 
LOG_DIR=/var/log
cd $LOG_DIR
 
cat /dev/null > messages
cat /dev/null > wtmp
 
echo "Logs cleaned up."

NOTE: Run this as root.

bash/files/cleaning_log_files.txt · Last modified: 2021/01/26 16:33 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki