Woah, do you keep that many rotated log generations?
You run into this kind of problem when the shell's globbing would expand to more chars than what your shell's max arg length is.
But this, at least on this Linux box of mine here, is quite a few chars anyway, viz.
Quote:
$ getconf ARG_MAX
131072
If you still want to keep that many files then you would have to refrain from globbing
and use something like this
Quote:
$ ls | grep \\.gz\$ | xargs zgrep 20/Aug/2008:13:50:23
i have encountered similar problems on servers keeping log files for 3 or 4 years
a new file is cerated evry 5 mins, so you can guess how many did i had to manage...
the proble is the expansion ( the * )
"ls *" is not the same as "ls"
ls * will be captuerd by the shell, and the * will replaced by the list of files in the current directory, separated by a whitespace.
when executing "ls" it will be ls the one to get the list.
keeping that in mind is all you need to work over that folder, but be aware that you are going to work mostly blind.
a few tips would be.
create a listing of the folder, soy ou dont have to re-list evrything all the time (my listing took more than 5 mins and made the server crawl)
ls > list-of-files
then, use other tools over that textfile, like grep or awk, ect
also, when you feel you are reado to work on the files, use a while, and read from that file
and expect alot of cpu usage, so if that server is actually doing some other stuff, then try to coordinate some downtime or window
you are gona make the server be slow, and other prioceses in the server are ging to make your work slower
Hello Folks ,
I am a new bie to the world of unix , what i am planning to do is the I have the location in server to which i am access through the putty and the location is /mt/ttlog/avccomn/logs/201901/19 and at this location the files are listed as show
startjmsnode1.sh_03.out... (7 Replies)
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)
Hi ,
I am running an application on my windows and it logs are generated at /var/logs and for this i have to go this location and then do tail -f , Is there any command you can advise me so that when I execute this command at this location that logs get displayed fully and as the application... (3 Replies)
without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Hey just need one simple syntax to search for the string from the Live Running Logs. The strings are placed in a $infile & everytime the script should pull each string from $infile and should provide as an input for grepping from Live running logs on a rotational basis.
So here are the Contents... (14 Replies)
Hi,
I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""... (3 Replies)
Hy, I have a question
I have a directory in a unix server,
Some of my files have a diffrent access time,
from the time i accessed them last,
I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Hey Guys,
i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user.
Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)