Nightly logs not separated

Discuss Applications
Post Reply
User avatar
Basher52
guru
guru
Posts: 918
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Nightly logs not separated

Post by Basher52 » Fri Apr 16, 2010 7:30 pm

I usually get some 4 to 6 nightly logs every day.
the first one is always just that log, but all others are "melted" together in one big M...F... file :(
And since one of the logs log every row affected it sure gets big and this log always gets in the top of everything else, thus making me has to browse down, waaaay down to see the others.
I've tried to fix this for the last two releases of Fedora, but no luck :(
Is there a way to do that?
(If anyone even know what I'm talking about)

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sat Apr 17, 2010 5:49 am

Can you be more specific? Which logs, which programs are creating those logs?

User avatar
Basher52
guru
guru
Posts: 918
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Sat Apr 17, 2010 1:28 pm

Most logs I create my own.
One is where I copy some files to my "backup" directory and later rar them to one file, split them up and mail my gmail account.
another is my nightly rkhunting log, another is a log from some database reorganizations.
A long time ago, like Fedora 5 or 6, they did create their own mail but now I only get one for the daily logwatch and then all other in one.
The later is very boring to scroll through and look at since most things are at the bottom.
btw, is there a way to in VI to scroll right away to the bottom of a file?
I've looked and tried lots but nothing seems to work.

Copperhead
scripter
scripter
Posts: 83
Joined: Wed May 14, 2003 1:12 am
Location: Los Angeles, CA, USA

Post by Copperhead » Mon Apr 26, 2010 4:34 am

In vi, to get to the bottom of a file, just look at the number of lines you have once you open your file. Then, enter command mode and enter the last line number. Suppose your file has 3432 lines. Just go to command mode and:

:3432 <enter>

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Apr 26, 2010 6:20 am

In vi/vim just press "G" (upper case G) which means "Go to bottom".

Copperhead
scripter
scripter
Posts: 83
Joined: Wed May 14, 2003 1:12 am
Location: Los Angeles, CA, USA

Post by Copperhead » Tue Apr 27, 2010 9:11 am

There is a package called "logrotate" that you could install that does most of that for you.

User avatar
Basher52
guru
guru
Posts: 918
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Tue Apr 27, 2010 9:49 am

logrotate is installed but I created my own logrotators for some other logs that I have.

Post Reply