Sponsored Content
Special Forums Hardware Filesystems, Disks and Memory scripts for rotation and compression of sys logs Post 16192 by witt on Tuesday 26th of February 2002 08:17:12 PM
Old 02-26-2002
You can do this :

Input this command into root cron :

30 23 * * * /rotate_syslog

This command execute the rotate_syslog at 23:30 o´clock everyday.

Script /rotate_syslog example :

#! /bin/sh
#
LOG=your_syslog
cd /syslog_path
test -f $LOG.3 && mv $LOG.2 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cat /dev/null > $LOG
chmod 644 $LOG


Witt

Last edited by witt; 02-27-2002 at 02:40 AM..
witt
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

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

2. Shell Programming and Scripting

User1 runs User2 scripts and updates logs?Is it possible?

Guys I have an odd request in hand. User1 Group1,Group2 User2 Group2,Group1 As can be seen ,both users belong to each other's group as well. Now User1 is holding some scripts(in a folder) on which perms are: 750 ..meaning User2 can read and execute but the execution is never successful... (1 Reply)
Discussion started by: ak835
1 Replies

3. UNIX for Advanced & Expert Users

Sun Cluster log rotation & compression

I currently have in root's crontab: 20 4 * * 0,3 /usr/cluster/lib/sc/newcleventlog /var/cluster/logs/eventlog 20 4 * * 0,3 /usr/cluster/lib/sc/newcleventlog /var/cluster/logs/DS 20 4 * * 0,3 /usr/cluster/lib/sc/newcleventlog /var/cluster/logs/commandlog there is no man page on... (1 Reply)
Discussion started by: rkruck
1 Replies

4. UNIX for Dummies Questions & Answers

Log Rotation

Hi Guys, Good morning, I just want to know and collect ideas on this one. Regarding rotation of logs as I've observed it's not consistently functioning. I have a server with 8 Partitions, each partition has a dedicated directory for the logs that is needed and I set it every 5mins (300secs) the... (1 Reply)
Discussion started by: rymnd_12345
1 Replies

5. Solaris

Log rotation

Hi All! I seem to have a problem with log rotation, unless I am doing something wrong, I have type the following command for testing purposes to see if the -s option works but he did not: logadm -w /var/adm/messages -C 8 -c -s 512k -t '/var/adm/messages.$n' -z 1 the file is now at this... (7 Replies)
Discussion started by: fretagi
7 Replies

6. AIX

Need help with warn messages in sys logs

Hello, Can you please look into the below warning messages on AIX sys logs ? is this related to application ? do we need to do anything from OS side ? we're running WAS on this LPAR. Feb 12 03:47:48 myserver user:warn|warning IBM Java: JVMJ9VM134W The system fullcore option is set to... (5 Replies)
Discussion started by: System Admin 77
5 Replies

7. UNIX for Dummies Questions & Answers

Best way to publish logs and reports from shell scripts?

Hello, I have been searching for some advice on this. I'm new to linux in a sys-admin kind of role, and I'm often asked to get information by running basic commands in the linux shell. For example, how many jobs running, grep a number of files, run a random program and output the results,... (4 Replies)
Discussion started by: allagher8
4 Replies

8. Shell Programming and Scripting

Time rotation

Hi, I'm trying to figure out Rsync Timings from my logs of the script. For this I have enabled a wrapper script to log start time and end time of the script so that I can catch the Rsync lapsed time. Below are the code lines I'm trying to use for Rsync time . INPUT is |Running the... (3 Replies)
Discussion started by: busyboy
3 Replies

9. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

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
LOG(3)							     Linux Programmer's Manual							    LOG(3)

NAME
log, logf, logl - natural logarithmic function SYNOPSIS
#include <math.h> double log(double x); float logf(float x); long double logl(long double x); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): logf(), logl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99 DESCRIPTION
The log() function returns the natural logarithm of x. RETURN VALUE
On success, these functions return the natural logarithm of x. If x is a NaN, a NaN is returned. If x is 1, the result is +0. If x is positive infinity, positive infinity is returned. If x is zero, then a pole error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively. If x is negative (including negative infinity), then a domain error occurs, and a NaN (not a number) is returned. ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions. The following errors can occur: Domain error: x is negative errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised. Pole error: x is zero errno is set to ERANGE. A divide-by-zero floating-point exception (FE_DIVBYZERO) is raised. CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD, C89. BUGS
In glibc 2.5 and earlier, taking the log() of a NaN produces a bogus invalid floating-point (FE_INVALID) exception. SEE ALSO
cbrt(3), clog(3), log2(3), log10(3), log1p(3), sqrt(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2010-06-13 LOG(3)
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy