12-09-2002
Maintain 30 days data
Hi Folks,
I have a log file that keeps the information pn the date and time a specific transaction is firedup. I found that the log file keeps growing and I intend to limit the entry to the log file to 30 days.
Log file name is transaction.log, here is the content:
120802_23:47:37 abbbbccccc
120802_23:52:23 accccddddd
120802_23:57:23 adddeeeee
120902_00:01:03 abbbbbccccc
120902_00:02:28 accccddddeee
120902_00:02:37 eeeeddddddbbb
120902_00:02:48 eeeddbbbb
120902_00:02:57 aaaaeee
The first column represent the execution date and time, while the right column indicate ths transaction name. Using the date, how can I limit the data in the transaction.log to 30 rolling days.
Thanks,
Odogbolu98
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
nislog(1M) System Administration Commands nislog(1M)
NAME
nislog - display the contents of the NIS+ transaction log
SYNOPSIS
/usr/sbin/nislog [-h num | -t num] [-v] [directory...]
DESCRIPTION
nislog displays the contents of the NIS+ server transaction log on the standard output. This command can be used to track changes in the
namespace. The /var/nis/trans.log file contains the transaction log maintained by the NIS+ server. When updates occur, they are logged to
this file and then propagated to replicas as log transactions. When the log is checkpointed, updates that have been propagated to the
replicas are removed.
The nislog command can only be run on an NIS+ server by superuser. It displays the log entries for that server only.
If directory is not specified, the entire log is searched. Otherwise, only those logs entries that correspond to the specified directories
are displayed.
OPTIONS
-h num Display num transactions from the ``head'' of the log. If the numeric parameter is 0, only the log header is displayed.
-t num Display num transactions from the ``tail'' of the log. If the numeric parameter is 0, only the log header is displayed.
-v Verbose mode.
FILES
/var/nis/trans.log transaction log
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWnisu |
+-----------------------------+-----------------------------+
SEE ALSO
nis+(1), rpc.nisd(1M), nisfiles(4), attributes(5)
NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are
available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html.
SunOS 5.10 12 Dec 2001 nislog(1M)