Search Results

Search: Posts Made By: AlexLi
Forum: Solaris 08-21-2013
8,475
Posted By jlliagre
That should be faster than with a same size non...
That should be faster than with a same size non sparse file. Anyway, I assumed the primary goal of the OP was to save disk space which the redirection does. My other point was about the cat /dev/null...
Forum: Solaris 08-21-2013
8,475
Posted By Corona688
People aren't going to be cat-ing a 19-gigabyte...
People aren't going to be cat-ing a 19-gigabyte sparse log file that, yesterday, they didn't even knew existed.

It's not ideal for all circumstances, no, but it ought to work here.
Forum: Solaris 08-21-2013
8,475
Posted By achenle
Try running "cat" or "grep" on a 300 GB or larger...
Try running "cat" or "grep" on a 300 GB or larger sparse file.

And imagine what kinds of fun will happen after that sparse file grows to a few terabytes in size and an admin who doesn't understand...
Forum: Solaris 08-21-2013
8,475
Posted By Peasant
There is already (stock out Solaris 11) entry in...
There is already (stock out Solaris 11) entry in /etc/logadm.conf
smf_logs /var/svc/log/*.log -C 8 -s 1m -c

On solaris 10 (i only have x86, above is new sparc), default smf_logs does not seem to...
Forum: Solaris 08-20-2013
8,475
Posted By achenle
That's not guaranteed to work. Depending on...
That's not guaranteed to work.

Depending on how the file was opened, how it's written to, and the specifics of how the underlying file system handles attempts to write past the end of a file, you...
Forum: Solaris 08-20-2013
8,475
Posted By bartus11
You already know how:cat /dev/null >...
You already know how:cat /dev/null > /path/to/logfileThis will zero the file without interrupting any processes that had it open.
Forum: Solaris 08-20-2013
8,475
Posted By hergp
That would truncate the logfile to length zero,...
That would truncate the logfile to length zero, because the redirection is handled by the shell before the tail command can do it's work.

As for the original question. You can truncate the...
Forum: Solaris 08-20-2013
8,475
Posted By hicksd8
I would keep the very end of the log and delete...
I would keep the very end of the log and delete the rest:


tail -n-1000 /var/svc/log/milestone-multi-user-server:default.log.0 > /var/svc/log/milestone-multi-user-server:default.log.0
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy