Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
IndeksPortailPencarianLatest imagesPendaftaranLogin

 

 Log cleaner

Go down 
PengirimMessage
Admin
Admin



Jumlah posting : 257
Registration date : 23.05.07

Log cleaner Empty
PostSubyek: Log cleaner   Log cleaner EmptyTue Dec 06, 2011 12:46 pm

this is just simple code for deleting logs from linux....please login as root before you run this script..
I use python multithreading method in my script...you can see and read the documentation in here http://www.tutorialspoint.com/python...ithreading.htm

Code:
#!/usr/bin/env python

import threading
import os
from time import sleep, ctime


print'''
.__
| | ____ ____
| | / _ \ / ___\
| |_( <_> ) /_/ >
|____/\____/\___ /
/_____/
cleaner

develope by jimmyromanticdevil
'''
lt = ctime()
print '[+] Starting log cleaner at %s\n\n' %(lt)
sleep(5)


class output_command(threading.Thread):
def __init__(self, command):
threading.Thread.__init__(self)
self.command = command
def run(self):
os.system(self.command)
print "[+]log was finish to clean......\n"

class input_command:
def __init__(self):
clear_add = ["rm -rf /tmp/logs","rm -rf $HISTFILE","rm -rf /root/.ksh_history","rm -rf /root/.bash_history","rm -rf /root/.bash_logout","rm -rf /usr/local/apache/logs","rm -rf /usr/local/apache/logs","rm -rf /usr/local/apache/log","rm -rf /var/apache/logs","rm -rf /var/apache/log","rm -rf /var/run/utmp","rm -rf /var/logs","rm -rf /var/log","rm -rf /var/adm","rm -rf /etc/wtmp","rm -rf /etc/utmp"]
for listt in clear_add:
try:
i=output_command(listt)
i.start()
except:
pass


if __name__ == "__main__":
objCaller = input_command()




hope you're enjoy ..^.^
Kembali Ke Atas Go down
https://anderleit.indonesianforum.net
 
Log cleaner
Kembali Ke Atas 
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
 :: Web Forum :: Phyton-
Navigasi: