Operating System - HP-UX
1748332 Members
3337 Online
108762 Solutions
New Discussion

Re: /var is 85%, need your help

 
redhat7012
Advisor

/var is 85% ....need your help ....friends...?

Hi,

 

/var is 85% need to bring the value below 85%.....How ?

 

Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol8    1159168  973360  174547   85% /var


 

I have checked the syslog directoty and it is consuming lot of space.

 

How to take back up of syslog file and then Nullify the original one.

 

Please help me with the commands.

 

-r--r--r--   1 root       sys           7570 Feb  8 09:54 syslog.log.old.gz
-r--r--r--   1 root       root        106134 Jul 14 00:01 mail.log
-r--r--r--   1 root       sys           8909 Jul 14 15:30 syslog.log
-rw-r--r--   1 root       sys              0 Jul 14 15:54 cp
-r--r--r--   1 root       sys        316234097 Jul 14 16:43 syslog.log

 

 

Here syslog.log file is consuming more space.

 

Please let me know the command to take the back up of it and then nullify the original one.

 

How to give date while taking backup of original file syslog.log ?

 

Regards,

Appu.

 

 

 

8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: /var is 85% ....need your help ....friends...?

There are a couple of ways to do this:

 

#1 -- Just stop and restart the syslog daemon.

 

# /sbin/init.d/syslogd stop

# /sbin/init.d/syslogd start

 

You will now have a file in /var/adm/syslog called OLDsyslog.log.  Now you can take the OLDsyslog.log and rename it and compress it.

 

#2 -- Copy syslog.log to another and then null the original.

 

# cd /var/adm/syslog

# cp -p syslog.log syslog.2012-14-jul.log

# cat /dev/null > syslog.log

# gzip syslog.2012-14-jul.log

 

redhat7012
Advisor

Re: /var is 85% ....need your help ....friends...?

Thank you for your assistance.
I sincerely appreciate the time you spent in helping me.


redhat7012
Advisor

Re: /var is 85% ....need your help ....friends...?

I want to know:

 

Q.) How to check the Version of HP-UX BOX ?

 

is it # uname -a ?

 

 

Patrick Wallek
Honored Contributor

Re: /var is 85% ....need your help ....friends...?

Yes, 'uname -a' will work.

Bill Hassell
Honored Contributor

Re: /var is 85% ....need your help ....friends...?

Since syslog.log is over 300 MB in size, I would very concerned about what is in that file. This is where failures and error messages are recorded. You need to look at the contents and verify that your system is healthy.



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: /var is 85%, need your help

>-r--r--r--   1 root       sys           8909 Jul 14 15:30 syslog.log
>-rw-r--r--   1 root       sys              0 Jul 14 15:54 cp
>-r--r--r--   1 root       sys        316234097 Jul 14 16:43 syslog.log

 

Is this really correct and two syslog.log files?  Does one have unprintable chars in the name?

Try "ll -b" to list the directory.

(You can also remove your bogus cp file.)

redhat7012
Advisor

Re: /var is 85% ....need your help ....friends...?

Hi

 

Want to know whether I have done right or wrong steps executed.

 

# /sbin/init.d/syslogd stop
syslogd stopped

# /sbin/init.d/syslogd start
System message logger started

# ls -lrt
total 622140
-r--r--r--   1 root       sys           7570 Feb  8 09:54 syslog.log.old.gz
-rw-r--r--   1 root       sys              0 Jul 14 15:54 cp
-r--r--r--   1 root       root        106569 Jul 15 00:01 mail.log
-r--r--r--   1 root       sys           9524 Jul 15 12:01 syslog.log
-r--r--r--   1 root       sys        317812919 Jul 15 12:04 OLDsyslog.log
-rw-r--r--   1 root       sys            821 Jul 15 12:04 syslog.log

# mv OLDsyslog.log OLDsyslog.log.old     

# ls -lrt

total 621076
-r--r--r--   1 root       sys           7570 Feb  8 09:54 syslog.log.old.gz
-rw-r--r--   1 root       sys              0 Jul 14 15:54 cp
-r--r--r--   1 root       root        106569 Jul 15 00:01 mail.log
-r--r--r--   1 root       sys           9524 Jul 15 12:01 syslog.log
-r--r--r--   1 root       sys        317812919 Jul 15 12:04 OLDsyslog.log.old
-rw-r--r--   1 root       sys          14114 Jul 15 12:15 syslog.log

# gzip OLDsyslog.log.old

# ls -lrt

total 24798
-r--r--r--   1 root       sys           7570 Feb  8 09:54 syslog.log.old.gz
-rw-r--r--   1 root       sys              0 Jul 14 15:54 cp
-r--r--r--   1 root       root        106569 Jul 15 00:01 mail.log
-r--r--r--   1 root       sys           9524 Jul 15 12:01 syslog.log
-r--r--r--   1 root       sys        12510791 Jul 15 12:04 OLDsyslog.log.old.gz
-rw-r--r--   1 root       sys          20896 Jul 15 12:19 syslog.log

/var is decreased to 60% now :

# bdf /var

Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol8    1159168  674295  454920   60% /var


I want to know whether I have executed right commands or not ?



Any help is appreciated.

 

 

Regards,

Appu.

 

 

Dennis Handly
Acclaimed Contributor

Re: /var is 85%, need your help

>I want to know whether I have executed right commands or not?

 

Well, you reduced the space.  But you didn't use "ll -b" to see the unprintable chars in syslog.log.

Also, Bill suggested you look at OLDsyslog.log before you gzipped it.

Perhaps a head -100 and tail -100 of it.