Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- logs=(
- "/var/log/auth.log.*"
- "/var/log/daemon.log.*"
- "/var/log/debug.*"
- "/var/log/fail2ban.log.*"
- "/var/log/kern.log.*"
- "/var/log/messages.*"
- "/var/log/syslog.*"
- "/var/log/vsftpd.log.*"
- "/var/log/apache2/access.log.*"
- "/var/log/apache2/error.log.*"
- "/var/log/apache2/other_vhosts_access.log.*"
- "/var/log/apache2/rutorrent_error.log.*"
- "/var/log/apache2/rutorrent.log.*"
- "/var/log/samba/log.nmbd.*"
- "/var/log/samba/log.smbd.*"
- )
- echo -e "\e[33mDeletings logs...\e[0m"
- for i in ${logs[*]}
- do
- if [ -e "$i" ]
- then
- echo -e "$i \e[32mDone\e[0m"
- sudo rm $i
- fi
- done
- echo -e "\e[33mAll of old logs deleted\e[0m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement