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
condor_preen(1) 					      General Commands Manual						   condor_preen(1)

Name
       condor_preen remove - extraneous files from Condor directories

Synopsis
       condor_preen [-mail] [-remove] [-verbose]

Description
       condor_preenexamines  the  directories belonging to Condor, and removes extraneous files and directories which may be left over from Condor
       processes which terminated abnormally either due to internal errors or a system crash. The directories checked are the  LOG  ,	EXECUTE  ,
       and   SPOOL directories as defined in the Condor configuration files. condor_preenis intended to be run as user	root or user  condor peri-
       odically as a backup method to ensure reasonable file system cleanliness in the face of errors. This is done automatically  by  default	by
       the condor_masterdaemon. It may also be explicitly invoked on an as needed basis.

       When  condor_preencleans the  SPOOL directory, it always leaves behind the files specified in the configuration variable  VALID_SPOOL_FILES
       as given by the configuration. For the  LOG directory, the only files removed or reported are those listed within the  configuration  vari-
       able   INVALID_LOG_FILES  list. The reason for this difference is that, in general, the files in the  LOG directory ought to be left alone,
       with few exceptions. An example of exceptions are core files. As there are new log files introduced regularly, it is less effort to specify
       those that ought to be removed than those that are not to be removed.

Options
       -mail

	  Send mail to the user defined in the	PREEN_ADMIN configuration variable, instead of writing to the standard output.

       -remove

	  Remove the offending files and directories rather than reporting on them.

       -verbose

	  List all files found in the Condor directories, even those which are not considered extraneous.

Exit Status
       condor_preenwill exit with a status value of 0 (zero) upon success, and it will exit with the value 1 (one) upon failure.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright  (C)  1990-2012  Condor  Team,  Computer  Sciences Department, University of Wisconsin-Madison, Madison, WI. All Rights Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012						   condor_preen(1)
All times are GMT -4. The time now is 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy