- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HELP !!! Can not delete the huge logs ...
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
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
тАО12-15-2002 11:48 PM
тАО12-15-2002 11:48 PM
I have an application directory full of a very huge number of log files. Whenever I am trying to list or delete the files; the UNIX replies with 'ksh: /usr/bin/ll: arg list too long'.
I have tried an external FTP application to access that directory and delete these logs but with no success also.
Do you have any healing potion for that desease? Any ideas ... scripts... HELP!!!!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2002 11:54 PM
тАО12-15-2002 11:54 PM
Re: HELP !!! Can not delete the huge logs ...
if you know logs' file names try to refine ll/rm output, for example
rm a*
rm b*
....
I wonder why ll tells 'arg list too long'. Maybe you have corrupt file names in directory? Foy example, beginning with '-' (like arg)? Or you supplying ll with arg using pipe?
Eugeny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2002 11:57 PM
тАО12-15-2002 11:57 PM
Re: HELP !!! Can not delete the huge logs ...
Use find . -name '*.log' -exec rm {} \;
Regards,
Raimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2002 11:57 PM
тАО12-15-2002 11:57 PM
SolutionFind and delete all files 30 days and older:
find /tmp/* -atime +30 -exec rm {} \;
replace /tmp for anything you want.
replace rm for any command you like .
C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 12:02 AM
тАО12-16-2002 12:02 AM
Re: HELP !!! Can not delete the huge logs ...
cd /dir
find . -name "*" -exec ls -l {} \;
find . -name "*" -exec rm {} \;
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 12:10 AM
тАО12-16-2002 12:10 AM
Re: HELP !!! Can not delete the huge logs ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 12:14 AM
тАО12-16-2002 12:14 AM
Re: HELP !!! Can not delete the huge logs ...
Try narrowing it down !
Just use 60 or 120 to make the list smaller.
I don't know how old the oldest file is ?
are they all from a recent date ?
Post the exact command you used to do the listing !
C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 12:25 AM
тАО12-16-2002 12:25 AM
Re: HELP !!! Can not delete the huge logs ...
I have tried the first part of it to only display the files and I could do this successfully. Now, I have added the Clemens???s timing part, which I really liked. Is that command OK with you and safe to execute ?????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 12:31 AM
тАО12-16-2002 12:31 AM
Re: HELP !!! Can not delete the huge logs ...
I would try this command first:
find . -name "pr.tr*.log" -atime +1 -exec ls -l {} \;???
Eventually it will come up with arg list too long.
Then replace the 1 for 5 or 10 to narrow down the list total.
If this works without arg list too long and the files you see are ok to delete then replace the ls -l for rm !
This just to be sure you delete the right files !!!!
C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 02:47 AM
тАО12-16-2002 02:47 AM
Re: HELP !!! Can not delete the huge logs ...
find /tmp/* ... then this is passing a huge list to the find command. This is not required and is in fact bad practice.
You should always if possible give find a directory name, not a list of files as the above syntax does. eg always use find . or find /, rather than find * or any other wildcard. The wildcards should be in your -name parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 02:58 AM
тАО12-16-2002 02:58 AM
Re: HELP !!! Can not delete the huge logs ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 03:02 AM
тАО12-16-2002 03:02 AM
Re: HELP !!! Can not delete the huge logs ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 03:11 AM
тАО12-16-2002 03:11 AM
Re: HELP !!! Can not delete the huge logs ...
find /logdirectory -atime +10 -exec ll {} \;
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 04:12 AM
тАО12-16-2002 04:12 AM
Re: HELP !!! Can not delete the huge logs ...
Hi Rami,
Use the following:
find /path -mame fileName -mtime +1
or
ls /dir | more
or
ls /dir | grep fileName
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 04:21 AM
тАО12-16-2002 04:21 AM
Re: HELP !!! Can not delete the huge logs ...
Hi,
Sorry, I made a typing mistake. the command should be like this:
# find /path -name filrname -mtime +1
or use the locate script if you know the names of those log files.
# locate fileName
or
# locate fileName | more
or
# locate fileName | grep string
where string is the name of the file
Script is attached and is also found in the scripts thread and update the the search databse frequently. Link: http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html
Good luck again...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 07:42 AM
тАО12-16-2002 07:42 AM
Re: HELP !!! Can not delete the huge logs ...
try to make a list off only a part of the files
or try:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc5620fe6d0f7d61190050090279cd0f9,00.html
It's a problem of ls, rm and mv that the argument list could be too long.
Try mtime as big as possible.
Regards
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2002 07:50 AM
тАО12-16-2002 07:50 AM
Re: HELP !!! Can not delete the huge logs ...
You mentioned that you were trying this:
'find pr.tr*.log -atime +30'
I think you may have a problem with the asterisk (*) getting expanded by the shell. Try it like this:
find -name 'pr.tr*.log' -atime +30
The single quotes will protect the * from the shell and keep it from getting expanded when the parameter is passed to the 'find' command.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 03:21 AM
тАО12-18-2002 03:21 AM
Re: HELP !!! Can not delete the huge logs ...
I executed a script which I have made to delete that log files found in 'ailogs.dat' one by one ...... This I found it more effecient than using 'find . -name "pr.tr*.log" -mtime +1 -exec rm {} \;'.
The script is as follow:
COUNT=0
cat ailogs.dat | while read currentLog
do
let COUNT=$COUNT+1
echo $COUNT $currentLog
rm $currentLog
done