10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: Sanjeev G
1 Replies
2. Shell Programming and Scripting
My scenario is as follows.
1. I have a reference file with the IP addresses and names
$ cat ref.list
10.11.xxx.xxx AA
10.12.xxx.xxx BB
10.13.xxx.xxx CC
10.14.xxx.xxx DD
2. A script runs and gets me one of the IP addresses and puts it in a separate file, for e.g... (2 Replies)
Discussion started by: Nagesh_1985
2 Replies
3. Shell Programming and Scripting
(qemu) migrate -d tcp:192.168.122.1:4444
(qemu) info migrate
capabilities: xbzrle: off
Migration status: completed
total time: 4425 milliseconds
downtime: 3 milliseconds
transferred ram: 130338 kbytes
remaining ram: 0 kbytes
total ram: 1057152 kbytes
duplicate: 232613 pages
normal:... (0 Replies)
Discussion started by: yanglei_fage
0 Replies
4. Shell Programming and Scripting
Hi,
If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ?
abc.log
reqquest id232342 , adfghfasdfsaf, TIME=30
reqquest id11111 , asdfdfghdffsaf, TIME=54
reqquest... (4 Replies)
Discussion started by: nariwithu
4 Replies
5. Shell Programming and Scripting
Hi,
If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ?
abc.log
reqquest id232342 , adfghfasdfsaf, TIME=30
reqquest id11111 , asdfdfghdffsaf, TIME=54
reqquest... (0 Replies)
Discussion started by: nariwithu
0 Replies
6. UNIX Desktop Questions & Answers
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)
Discussion started by: KAREENA18
3 Replies
7. Shell Programming and Scripting
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)
Discussion started by: harish.parker
3 Replies
8. Shell Programming and Scripting
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)
Discussion started by: charbel
5 Replies
9. UNIX for Dummies Questions & Answers
can i include this command into my crontab file
> /var/adm/wtmp
to clear the contents on a regular basis ?
what about file permissions ? (6 Replies)
Discussion started by: cubicle^dweller
6 Replies
10. UNIX Desktop Questions & Answers
hi
My name is Juan
I dont can clear wtmp and similiar files
how i do it?
thanks (4 Replies)
Discussion started by: jtapia
4 Replies
ROTATELOGS(8) rotatelogs ROTATELOGS(8)
NAME
rotatelogs - Piped logging program to rotate Apache logs
SYNOPSIS
rotatelogs [ -l ] [ -f ] logfile rotationtime|filesizeM [ offset ]
SUMMARY
rotatelogs is a simple program for use in conjunction with Apache's piped logfile feature. It supports rotation based on a time interval or
maximum size of the log.
OPTIONS
-l Causes the use of local time rather than GMT as the base for the interval or for strftime(3) formatting with size-based rotation.
Note that using -l in an environment which changes the GMT offset (such as for BST or DST) can lead to unpredictable results!
-f Causes the logfile to be opened immediately, as soon as rotatelogs starts, instead of waiting for the first logfile entry to be read
(for non-busy sites, there may be a substantial delay between when the server is started and when the first request is handled,
meaning that the associated logfile does not "exist" until then, which causes problems from some automated logging tools). Available
in version 2.2.9 and later.
logfile
rotationtime
The time between log file rotations in seconds. The rotation occurs at the beginning of this interval. For example, if the rotation
time is 3600, the log file will be rotated at the beginning of every hour; if the rotation time is 86400, the log file will be
rotated every night at midnight. (If no data is logged during an interval, no file will be created.)
filesizeM
The maximum file size in megabytes followed by the letter M to specify size rather than time.
offset The number of minutes offset from UTC. If omitted, zero is assumed and UTC is used. For example, to use local time in the zone UTC
-5 hours, specify a value of -300 for this argument. In most cases, -l should be used instead of specifying an offset.
EXAMPLES
CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common
This creates the files /var/logs/logfile.nnnn where nnnn is the system time at which the log nominally starts (this time will always be a
multiple of the rotation time, so you can synchronize cron scripts with it). At the end of each rotation time (here after 24 hours) a new
log is started.
CustomLog "|bin/rotatelogs -l /var/logs/logfile.%Y.%m.%d 86400" common
This creates the files /var/logs/logfile.yyyy.mm.dd where yyyy is the year, mm is the month, and dd is the day of the month. Logging will
switch to a new file every day at midnight, local time.
CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common
This configuration will rotate the logfile whenever it reaches a size of 5 megabytes.
ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"
This configuration will rotate the error logfile whenever it reaches a size of 5 megabytes, and the suffix to the logfile name will be cre-
ated of the form errorlog.YYYY-mm-dd-HH_MM_SS.
PORTABILITY
The following logfile format string substitutions should be supported by all strftime(3) implementations, see the strftime(3) man page for
library-specific extensions.
o %A - full weekday name (localized)
o %a - 3-character weekday name (localized)
o %B - full month name (localized)
o %b - 3-character month name (localized)
o %c - date and time (localized)
o %d - 2-digit day of month
o %H - 2-digit hour (24 hour clock)
o %I - 2-digit hour (12 hour clock)
o %j - 3-digit day of year
o %M - 2-digit minute
o %m - 2-digit month
o %p - am/pm of 12 hour clock (localized)
o %S - 2-digit second
o %U - 2-digit week of year (Sunday first day of week)
o %W - 2-digit week of year (Monday first day of week)
o %w - 1-digit weekday (Sunday first day of week)
o %X - time (localized)
o %x - date (localized)
o %Y - 4-digit year
o %y - 2-digit year
o %Z - time zone name
o %% - literal `%'
Apache HTTP Server 2010-11-06 ROTATELOGS(8)