1745910 Members
3981 Online
108723 Solutions
New Discussion юеВ

samba log cleaning

 
SOLVED
Go to solution
p7
Frequent Advisor

samba log cleaning

hi all

we are setup for log level 1 and samba server at user level with about 300 users logging in. we just want some basic logging for troubleshooting, but it generates alot of logs. does anyone know of a script that cleans, lets say yesterdays logs, etc?

thx in advance
4 REPLIES 4
Deoncia Grayson_1
Honored Contributor

Re: samba log cleaning

you can limit the log size in the smb.conf file.

max log size= ????

this will allow you to resrict the size of the log files
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Steven E. Protter
Exalted Contributor
Solution

Re: samba log cleaning

Shalom pasquale,

There is a problem in general with logging.

The default samba log creates a log for each user. This is annoying. I'd take the %m out of the log setup of smb.conf as a start and then end up with just one little log.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/

Log rotate is a great tool for organizing and archiving logs.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
p7
Frequent Advisor

Re: samba log cleaning

thx!

will try
eric roseme
Respected Contributor

Re: samba log cleaning

Hello Pasquale,

There is no "problem" with CIFS/Samba logging. Samba logging is very configurable, so it is easy to configure the behavior that is correct for your environment.

We set the CIFS default logging config to use "%m" because that provides the most useful logging information. If you consolidate all of the user logs into a single file, you will have difficulty associating a user/session with a particular entry, so then data will be meaningless.

At "log level = 1" the data logged is minimal, and by setting the logfile size as Deoncia suggested, you can minimize the cumulative storage space required. Or, you can set the log level to 0 (which only logs errors).

You could also write a script that does a "> log.netbiosID" or "> log.IPaddress" for every log file in the /var/opt/samba directory. Run that daily and it will clear out all logged data, but leave the files.

These methods will leave you with 300 files, or possibly 600 files (depends on how your clients are connecting), but the data that you collect will be useful. If you do not require useful log data, then you can send all log data to smbd.log.

Eric Roseme