0

I've noticed recently that Samba is creating a large number of log files on my server which meant I couldn't create any new files as it had used up my inode count.

I cleaned up a large amount of old files and I thought I had set my logs to rotate every 3 days by editing my samba entry in /etc/logrotate.d

/var/log/samba/log.smbd {
        daily
        missingok
        rotate 3
        postrotate
                /etc/init.d/smbd reload > /dev/null
        endscript
        compress
        notifempty
}


/var/log/samba/log.nmbd {
        daily
        missingok
        rotate 3
        postrotate
                [ ! -f /var/run/samba/nmbd.pid ] || kill -HUP `cat /var/run/samba/nmbd.pid`
        endscript
        compress
        notifempty
}

However this doesn't seem to have had any effect and logs are retained until it seems I delete them.

Does Samba have it's own rotation setting somewhere? Am I ok just turning this off completely?

I didn't notice this until I updated from ubuntu 14 to 16.04 - but at the same time one of my web apps has increased in popularity considerably so it could just be I'm getting more traffic.

TommyBs
  • 179
  • 2
  • 10
  • I'm not sure right now what would be default on 16.04 ( or 14 ), but see if you have something like this in smb.conf : log file = /var/log/samba/log.%m . And "max log size" . In that case is handled by Samba – Sandor Marton Dec 06 '17 at 23:13
  • Hi I do see these 2 lines. But the max log size is the size of individual files right and not the number of files? As I say I see thousands of entries for different IPs as different files. Is it just a question of changing the log file value to something static rather than log.%m? – TommyBs Dec 07 '17 at 09:29
  • Yes, max log size is the individual log sizes. And yes, you can change 'log file' to something static . Also you may have the log level raised, 'log level' line . – Sandor Marton Dec 07 '17 at 17:47

0 Answers0