# question about the /var directory



## dongsky (Jun 23, 2010)

Hi guyz, If I will delete all the items or data that are under in the /var/log directory, my question is, Does the /var and under of its many log files and also other files that are related to this directory will affect my system and Im using nagios under FreeBSD, because when I restart my system that running under FreeBSD it doesn't run at all and there's an error it says that "Starting Nagios....stop, error...../var filesystem is full...".

any suggestion or guide so that I can start again my system.


----------



## nekoexmachina (Jun 23, 2010)

As i understand, yes you can delete old logs from /var/logs. 
Their deletion will not affect your system working process.

You should set up sysutils/logrotate to avoid that situation in the future. (any base-system solution, not with cron and self-written scripts?)


----------



## jalla (Jun 23, 2010)

nekoexmachina said:
			
		

> You should set up sysutils/logrotate to avoid that situation in the future. (any base-system solution, not with cron and self-written scripts?)



Log rotation is handled by newsyslog(8). Edit /etc/newsyslog.conf to control the size and number of logfiles to keep.


----------



## SirDice (Jun 23, 2010)

Better idea, find out what's filling up your /var. Any databases stored in /var/db/? Move those to a filesystem with more space.


----------



## fronclynne (Jun 23, 2010)

Yeah, /var/db/pkg/ can get pretty large especially if you use ports-mgmt/portupgrade, and /var/db/portsnap/ (& frankly /var/db/sup/ if you use that).  See portsnap(8) & csup(1) for how to move that stuff to another filesystem.


----------



## SirDice (Jun 23, 2010)

I've never had /var/ actually filling up with base OS related stuff and I've always used the standard size filesystem. If I'm not mistaken mysql will store it's databases in /var/db/ by default. I know those can get big and should really be on their own filesystem(s). Most likely postgresql will do the same if not configured.


----------

