Root filesystem full: /var/log > 1.8 GB
Smoot Carl-Mitchell
smoot at tic.com
Mon Oct 13 20:08:00 UTC 2008
On Mon, 2008-10-13 at 15:39 -0400, Hal Burgiss wrote:
> On Mon, Oct 13, 2008 at 09:17:29PM +0200, Marcin 'Qrczak' Kowalczyk wrote:
> > 2008/10/13 Hal Burgiss <hal at burgiss.net>:
> >
> > > cat /dev/null > /var/log/$some_log
> >
> > "cat /dev/null" is an expensive way to spell "true" or ":", a command
> > which does nothing.
>
> How does one empty a logfile with 'true' or ':' and make sure logging
> is not adversely effected?
In bash (and some other shells) you can just do:
> file
This truncates the file. I was a csh user for many years and it does not
support null commands. The above will return an error.
cat /dev/null >file
on the other hand is a pretty well known idiom and works with all
shells.
--
Smoot Carl-Mitchell
System/Network Architect
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005
More information about the ubuntu-users
mailing list