1

Sorry if it's a stupid question. I would like to free up some space and /var/log is full of logs. I do not intend to use any of the log files, so I don't care if they get deleted or not. But I afraid that it may affect the functionality of the services that produce logs. I understand that it may depend on the program that produces the logs. but Do you think it would be safe to remove regular services and system log such as:

alternatives.log
auth.log
boot.log                 
mail.log     
syslog
dmesg
dpkg
faillog
fontconfig.log
kern.log
wtmp
nginx/*
apt/*
btmp
Alex
  • 211

1 Answers1

0

It is actually safe. you can also zero them out > /var/log/nginx/error.log for example. You can also but these in a script and call it with cron

Crontab: 1 5 */2 * 0 /home/user/scripts/delnginxlogs.sh

Actual script:

cd /var/log/nginx
rm *.gz
> domain-ssl-access.log
> domain.org-ssl-error.log
> domain.com-ssl-access.log
> domain.com.-ssl-error.log

etc,etc

PerlDuck
  • 13,885