- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: a log file has a so big size ! even large then...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:11 AM
тАО05-12-2009 01:11 AM
bdf show:
Filesystem kbytes used avail %used Mounted on
/dev/vgfile/lvmsg 20480000 4309873 15159596 22% /msg
and in the directory ll show:
total 6905078
-rw-r--r-- 1 msg users 131288693050 May 12 09:15 queue_10.err
Now ,I've known the file is a sparse file for du -sk show the true size about 4G+,and xd show large of "0" from head of the file.
What I want to know is:
1.How can i reduce the file,or make the ll's show as nomal
2.The admin have clear the file by #>quwue_10.err. Is this a right way?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:29 AM
тАО05-12-2009 01:29 AM
Re: a log file has a so big size ! even large then the filesystem!
If you do not need the to keep a copy of the data, you can zeroing the file;
# > /full_path_to_file/queue_10.err
or
# cp /dev/null /full_path_to_file/queue_10.err
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:29 AM
тАО05-12-2009 01:29 AM
Re: a log file has a so big size ! even large then the filesystem!
#>quwue_10.err. Is this a right way?
this will balnk whole file and remain same attribute, if you feel this file doesnt require can do this, yes this is correct way, thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:38 AM
тАО05-12-2009 01:38 AM
Re: a log file has a so big size ! even large then the filesystem!
You can use this as well.
#cat /dev/null > /path of the the file
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:38 AM
тАО05-12-2009 01:38 AM
Re: a log file has a so big size ! even large then the filesystem!
My doubt:the admin use > clear a 5G file but when app reopen the file ,the size increase begin from 5G!So a 5G true size file maybe show us 10G by ls -l.and so on
the file will bigger and bigger....
Is this possble?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:42 AM
тАО05-12-2009 01:42 AM
Re: a log file has a so big size ! even large then the filesystem!
The correct way of trimming any type of log file is
# > filename
It will trim your file to 0 (zero) bytes.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:43 AM
тАО05-12-2009 01:43 AM
Re: a log file has a so big size ! even large then the filesystem!
no because when the file will be reopen the size will be zero.
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 01:54 AM
тАО05-12-2009 01:54 AM
Re: a log file has a so big size ! even large then the filesystem!
In that case terminate the process which uses the space using lsof then restart the process.
The space will be released by the process only after it terminates.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 02:12 AM
тАО05-12-2009 02:12 AM
Re: a log file has a so big size ! even large then the filesystem!
use the trimming by "> filename" only if it contains plain text. Doing this to a binary file (for example /var/adm/wtmp) can corrupt the file so that it will no more be readable by the process that uses it.
J.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 02:48 AM
тАО05-12-2009 02:48 AM