LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices



Reply
 
Search this Thread
Old 04-04-2006, 04:42 PM   #1
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Rep: Reputation: 30
Clearing the var/log/adm/messages?


I just checked my var/log/adm/messages and its becoming very full..How can I clear those messages so they will not take any space up?

thanks
 
Old 04-04-2006, 05:05 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Code:
$ ls -l /var/log/adm/messages
/var/log/adm/messages: No such file or directory
Can you clarify about which files are growing ?
 
Old 04-04-2006, 08:59 PM   #3
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
Im sorry..its

/var/adm/messages
 
Old 04-05-2006, 09:14 AM   #4
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 165

Rep: Reputation: 30
Post Error files

It seems they are readable log files.
see ls -al messages*
View them and delete the old ones, if u don't want them.
 
Old 04-05-2006, 10:31 AM   #5
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
# ls -al messages
messages: No such file or directory


I dont get it...Can you explain or post a command on how to remove all of those messages and let the logs start all over again? Thanks

Or...can I just logon as root and then highlight the ones that I dont need and then just hit the backspace button? Please explain..

Last edited by as400; 04-05-2006 at 10:32 AM.
 
Old 04-05-2006, 12:00 PM   #6
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 682

Rep: Reputation: 63
What version of solaris are you using?

If it's 9 or higher you can use logadm to manage the logs. I believe it is a root cron job by default.

If you just want to delete the logs cat /dev/null > /var/adm/messages .
 
Old 04-05-2006, 01:58 PM   #7
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 165

Rep: Reputation: 30
Post messages*

Dear as400
ls -al messages* (Note the '*')

Also see man syslogd
 
Old 04-05-2006, 02:04 PM   #8
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
# Apr 5 11:02:45 unknown su: 'su root' succeeded for vinand on /dev/pts/4
ls -al messages*
messages*: No such file or directory


I tried that too WITH the * before also....

I just want to clear all the logs to prevent them from taking up disk space. And then I want them to restart again...

Thats all.
 
Old 04-05-2006, 02:12 PM   #9
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 165

Rep: Reputation: 30
Post Sorry

Im sorry..its

ls -al /var/adm/messages*

In my system I have many files.
messages (this is latest, So I can remove the remaining below)
messages.0
messages.1 etc

Plus u can
ls /etc/syslog.conf
If it exists do the following
>/var/adm/messages
syslogd -f /etc/syslog.conf


Now u see ls -al /var/adm/messages*

Last edited by AbrahamJose; 04-05-2006 at 02:34 PM.
 
Old 04-05-2006, 05:54 PM   #10
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
$ ls -al /var/adm/messages*
-rw-r--r-- 1 root root 10586 Apr 5 14:03 /var/adm/messages
-rw-r--r-- 1 root root 2133982 Apr 5 10:08 /var/adm/messages.0


OK..All I want is to clear all the messages...And i wanted to start from the recent date.

I dont understand the last command..

what does this do???
Code:
>/var/adm/messages
syslogd -f /etc/syslog.conf
Your posting commands that I dont know what there are without you explaining them is no help to me...

Last edited by as400; 04-05-2006 at 05:59 PM.
 
Old 04-05-2006, 06:26 PM   #11
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 682

Rep: Reputation: 63
Maybe I'm not understanding what you are attempting to do...

If all you want to do is delete the old messages then
rm /var/adm/messages*

If you don't understand that please say so.
From your ls output it appears that you have some log rotation going so the files will regenerate over time.
 
Old 04-05-2006, 08:39 PM   #12
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
man logadm
 
Old 04-10-2006, 10:15 PM   #13
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Quote:
Originally Posted by Blinker_Fluid
If all you want to do is delete the old messages then
rm /var/adm/messages*
Don't think rm is the right option. That way filedescriptors will stay open to the deleted file, right?

I always just use:

> /var/adm/messages

This will clear the log and you don't need to restart anything.
 
Old 04-11-2006, 12:01 PM   #14
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
Is it like this:??

> /var/adm/messages

and thats it???

what does the " > " mean?
 
Old 04-11-2006, 01:51 PM   #15
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Thats it

The > puts everything in front of the > in the file. Like if you would do: echo test > /var/adm/messages it would overwrite your file with only the word test

With two > you will add text to the end of the file, for example: echo test >> /var/adm/messages would append the word test to the file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 07:39 PM
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 05:03 PM
/var/log/messages full of these messages. Should I be concerned? mdavis Linux - Security 5 04-16-2004 11:08 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 09:38 PM
/var/adm/messages & syslog Khalid Linux - General 0 11-08-2001 06:40 PM


All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration