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 |
Code:
$ ls -l /var/log/adm/messages |
Im sorry..its
/var/adm/messages |
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. |
# 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.. |
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 . |
messages*
Dear as400
ls -al messages* (Note the '*') Also see man syslogd |
# 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. |
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* |
$ 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 |
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. |
man logadm
|
Quote:
I always just use: > /var/adm/messages This will clear the log and you don't need to restart anything. |
Is it like this:??
> /var/adm/messages and thats it??? what does the " > " mean? |
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. |
Now do I have to do this from the COMMAND terminal? Or in the files directory itself??
|
Solaris 9 uses "logadm" to rotate log files, including /var/adm/messages. Prior to Solaris 9 there was a root cron job.
You can always manually clear the log: Code:
# cp /dev/null /var/adm/messages Mark |
Instead of "cp /dev/null", you can also run the simpler:
Code:
> /var/adm/messages |
All times are GMT -5. The time now is 01:17 PM. |