#! /usr/bin/env python
import os,subprocess
from stat import *
# Cleanup
# Run as root, of course.
cd /var/log
# Cleanup
# Run as root, of course.
os.chdir("/var/log")
cat /dev/null > messages
_rc = subprocess.call("cat /dev/null",shell=True,stdout=file('messages','wb'))
cat /dev/null > wtmp
_rc = subprocess.call("cat /dev/null",shell=True,stdout=file('wtmp','wb'))
echo "Log files cleaned up."
print("Log files cleaned up.")
ÿ