Sponsored Content
Full Discussion: Maintain 30 days data
Top Forums Shell Programming and Scripting Maintain 30 days data Post 33040 by perleo on Saturday 14th of December 2002 09:13:02 AM
Old 12-14-2002
You saying, you want to clear out the log file,after 30 days.

Well heres a perl script i wrote to clear out a log file.if ur anygood at perl ( unlike me ) you can adapt it or use cron to run it.

code below :

#util to clear log file
#version 1.0
#-colinok

#usr/bin/perl

#open file
open (LOG, "> ENTER PATH TO FILE HERE ")
$log = LOG;

#clear file
print clear $log;

#close file
close (LOG);


hope this helps

- PERLEO
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ls latest 4 days or specify days of files in the directory

Hi, I would like to list latest 2 days, 3 days or 4 days,etc of files in the directory... how? is it using ls? (3 Replies)
Discussion started by: happyv
3 Replies

2. Shell Programming and Scripting

Add data in days:hours:min:sec format

I want to add these no. these are in the format of days:hours:minutes:sec I want result in this format only 0:00:04:59 0:00:00:12 0:00:00:28 0:00:00:03 0:01:29:35 0:00:00:19 0:01:05:21 Is any body ca help me????? To get This.. Thanks Nishant (1 Reply)
Discussion started by: krishna_sicsr
1 Replies

3. UNIX for Dummies Questions & Answers

How to maintain the content of array in any directory I go?

Hi all, I have this scenario where:- The file that I want to save its name into array df is my.08120323.trx which is located in the dir as below: $ pwd /u01/abc/def/SRC_datafiles $ ls *trx my.08120323.trx $ df=*"trx" ##keeping the filename... (1 Reply)
Discussion started by: luna_soleil
1 Replies

4. UNIX for Dummies Questions & Answers

maintain database script...

Hi there. i'm new user at here I need help for this. I need to write a script that maintains a database of cryptographic checksums. In other words, I need this script to check the files checksum whether the files has been modified or not. But i got no idea where to start. Hope anyone here can... (8 Replies)
Discussion started by: hihihehe
8 Replies

5. UNIX for Dummies Questions & Answers

Just asking - Tips on how to maintain your scripts ..

Hi all, Just writing to ask if any one can advise on what tools to use best for maintaining your scripts ... preferably free/open source and portable if there is one, that is, one that can be placed and run on a USB stick ... At the moment, am having them in directories and files and no... (2 Replies)
Discussion started by: newbie_01
2 Replies

6. Shell Programming and Scripting

Log maintain in Perl

hi , While working on perl, have to write a continuous log file which I can monitor. I tried like, open (LOG,'>'.$log.'/Report_'.$todaysdate.'.log') or die("Unable to create the log file"); print LOG "\nDate : ".`date`; But when I ran the script in backend and monitor log, it... (1 Reply)
Discussion started by: Deei
1 Replies

7. Shell Programming and Scripting

maintain 32bit and 64bit C code

Hi, I have a C code which builds and works fine on 32bit linux machine. Now i want to convert that code to build and run on 64 bit linux machine. I dont want to maintain two separate sources for 32 and 64 bit build. Same source should get build on 32 as well as 64 bit machine (when a... (2 Replies)
Discussion started by: bhushan123
2 Replies

8. UNIX for Dummies Questions & Answers

Script that will Delete and Maintain Files

Hi guys, Good day to all and Happy New Year!!! Cheers!!! I hope anyone could help/suggest me on hot to create a script that will monitor the directory where files are being dumped. I have a script in CRON that runs everyday and collect for logs with a filename of Output_$(date... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

9. Shell Programming and Scripting

Cleanup a log file data every 2 days

How do i cleanup a log file data every 2 days, I was using below command in a script to remove log file every 2 days, but looks like its not working as log file date and time gets updated every 5 mins. Is there a way ? find ./ \( -name . -o -prune \) -type f -mtime -2 -name... (9 Replies)
Discussion started by: aix_admin_007
9 Replies

10. Shell Programming and Scripting

Collect last 2 days data from /var/log/messages

I need to collect last 2 days data from /var/log/messages into a separate file (file format: flmessagetimedaymonth). I have collect today's month, date, time information in separate variable. Please help me in this issue (Probably need awk and grep function). month=$(date|awk '{print $2}')... (4 Replies)
Discussion started by: makauser
4 Replies
vxtranslog(1M)															    vxtranslog(1M)

NAME
vxtranslog - administer transaction logging SYNOPSIS
vxtranslog [-H] [-l] [-m {on|off}] [-n number] [-q {on|off}] [-s size] DESCRIPTION
The vxtranslog command is used to administer transaction logging in Veritas Volume Manager (VxVM). This feature can be used to record transactions that are carried out by the vxconfigd daemon at the request of VxVM commands, and can be used in conjunction with the command logging feature (see vxcmdlog(1M)). When the current log file reaches a maximum size, it is renamed as a historic log file, and a new current log file is created. A limited number of historic log files is preserved to avoid filling up the file system. In addition, logging of query requests is turned off by default to prevent the log files from being filled too quickly. Each log file contains a header that records the host name, host ID, and the date and time that the log was created. See the EXAMPLES sec- tion below for a description of the entries that are recorded in a log file. OPTIONS
-H Displays detailed help about the usage of the command. -l Lists current settings for transaction logging. This shows whether transaction and query logging are enabled, the maximum number of historic log files, and the maximum log file size. -m {on|off} Turns transaction logging on or off. By default, transaction logging is turned on, but query logging is turned off. Query log- ging can be turned on by using the -q option. -n number Sets the maximum number of historic log files to maintain. The default number is 5. If number is set to no_limit, there is no limit on the number of historic log files that are created. -q {on|off} Turns query logging on or off. By default, query logging is turned off to prevent the log files filling too rapidly. -s size Sets the maximum size to which a transaction log can grow. (Note that this setting has no effect on existing historic log files.) The suffix modifiers k, m, and g may be used express sizes in kilobytes, megabytes and gigabytes respectively. If no suffix is specified, the default units are kilobytes. If size is set to no_limit, there is no limit on the size of the log file. The size of the transaction log is checked after an entry has been written so the actual size may be slightly larger than that specified. When the log reaches the specified size, the current transaction log file, translog, is renamed as the next available historic log file, translog.number, where number is an integer from 1 up to the maximum number of historic log files that is cur- rently defined. If the maximum number of historic log files has been reached, the oldest historic log file is removed, and the current log file is renamed as that file. The default maximum size of the transaction log file is 1m(1MB). EXAMPLES
Turn on query logging: vxtranslog -q on Set the maximum transaction log file size to 512KB: vxtranslog -s 512k Set the maximum number of historic transaction log files to 10: vxtranslog -n 10 The following are sample entries from a transaction log file: Thu Feb 13 19:30:57 2003 Clid = 26924, PID = 3001, Part = 0, Status = 0, Abort Reason = 0 DA_GET SENA0_1 DISK_GET_ATTRS SENA0_1 DISK_DISK_OP SENA0_1 8 DEVNO_GET SENA0_1 DANAME_GET 0x1d801d8 0x1d801a0 GET_ARRAYNAME SENA 50800200000e78b8 CTLR_PTOLNAME /pci@1f,4000/pci@5/SUNW,qlc@4/fp@0,0 GET_ARRAYNAME SENA 50800200000e78b8 CTLR_PTOLNAME /pci@1f,4000/pci@5/SUNW,qlc@5/fp@0,0 DISCONNECT <no request data> The first line of each log entry is the time stamp of the transaction. The Clid field corresponds to the client ID for the connection that the command opened to vxconfigd. The Status and Abort Reason fields contain error codes if the transaction does not complete normally. The remainder of the record shows the data that was used in processing the transaction. Note: The client ID is the same as that recorded for the corresponding command in the command log. FILES
/etc/vx/log Symbolic link to the log directory. This can be redefined if necessary. /etc/vx/log/translog Current transaction log. /etc/vx/log/translog.number Historic transaction logs. SEE ALSO
vxcmdlog(1M) Veritas Volume Manager Troubleshooting Guide VxVM 5.0.31.1 24 Mar 2008 vxtranslog(1M)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy