Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Spooling a log file with timestamp Post 48991 by google on Tuesday 23rd of March 2004 08:02:00 AM
Old 03-23-2004
Well, if I understand you correctly, this is easy. After your shell script logs into Oracle and runs your sql, then disconects, use a mv command to rename your file.
%T gives a time format inmilitary time like 21:01:54

SPOOL-NAME=blah-blah-blah
NEW-FILE-NAME=$SPOOL-NAME_$(date +'%T').csv


mv $SPOOL-NAME $NEW-FILE-NAME
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Copy lines from a log file based on timestamp

how to copy lines from a log file based on timestamp. INFO (RbrProcessFlifoEventSessionEJB.java:processFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete! INFO (RbrPnrProcessEventSessionEJB.java:processFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin:... (1 Reply)
Discussion started by: ranjiadmin
1 Replies

2. Shell Programming and Scripting

concatenate log file lines up to timestamp

Hi, Using sed awk or perl I am trying to do something similar to https://www.unix.com/shell-programming-scripting/105887-sed-awk-concatenate-lines-until-blank-line-2.html but my requirement is slightly different. What I am trying to accomplish is to reformat a logfile such that all lines... (4 Replies)
Discussion started by: AlanC
4 Replies

3. UNIX for Dummies Questions & Answers

Creating a Tar file while files are spooling

Hi I have done a search for this but couldn't find much on it. I am creating a tar file with the command below tar cvf /export/home/user/backup/*Will this is being created I have a job spooling to 5 texts files in the following directory /export/home/user/backup/STATS/ The tar files... (1 Reply)
Discussion started by: sgarvan
1 Replies

4. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

If a log file is in the following format 28-Jul-10 ::: Log message 28-Jul-10 ::: Log message 29-Jul-10 ::: Log message 30-Jul-10 ::: Log message 31-Jul-10 ::: Log message 31-Jul-10 ::: Log message 1-Aug-10 ::: Log message 1-Aug-10 ::: Log message 2-Aug-10 ::: Log message 2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies

5. Shell Programming and Scripting

Spooling file to excel

Hi , Im spooling file from oracle to csv using shell script. Below is the code im using.. The o/p is not coming in right format.. Please help me out in this.. O/p is coming as header till batch id ,im not able to see date_stored,type,type1.. Please any one can give me some suggestion ... (1 Reply)
Discussion started by: jkumsi
1 Replies

6. Shell Programming and Scripting

prepend timestamp to continiously updating log file

Hi, I have a process which outputs to a log. Below is the code snippet: process &> $LOGFILE& The log file keeps on updating whenever a transaction is processed. The log file has a time stamp added so every time I kill the process and start the process a new log file is... (4 Replies)
Discussion started by: rajkumarme_1
4 Replies

7. Shell Programming and Scripting

Script not spooling in result file

Hi everyone and nice to meet you :) I'm having some issues with a script I'm writing. It's probably most chaotic, I'm no ksh guru, but the idea is to extract an ID with that query, spool it into a file, and read that file making the ID a variable. This has to be done for every row extracted by... (10 Replies)
Discussion started by: Arkadia
10 Replies

8. Shell Programming and Scripting

Bash Script Closest Timestamp (LOG FILE)

Hi All, I need something where I could take the date from FILE1 and in this case the date is Thu Sep 10 13:48:42 EDT 2015 and I need it to match the closest PREVIOUS date in the log file FILE2 this means in this specific case it would be Thu Sep 10 2015 13:35:28. I only need the closest... (3 Replies)
Discussion started by: roberto999
3 Replies

9. UNIX for Beginners Questions & Answers

Script not spooling in the designated file.

Hi, I need to write a script that will run a simple select count(*) query and sends the result of that query to me via email. Here's what I already have. #!/bin/ksh ###################################################################### # File Name : counts.sh # Created : 2019/27/19... (1 Reply)
Discussion started by: clef
1 Replies

10. UNIX for Beginners Questions & Answers

Filter records from a log file based on timestamp

Dear Experts, I have a log file that contains a timestamp, I would like to filter record from that file based on timestamp. For example refer below file - cat sample.txt Jan 19 20:51:48 mukul-Vostro-14-3468 systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)... (6 Replies)
Discussion started by: mukulverma2408
6 Replies
Time::Duration::Parse(3pm)				User Contributed Perl Documentation				Time::Duration::Parse(3pm)

NAME
Time::Duration::Parse - Parse string that represents time duration SYNOPSIS
use Time::Duration::Parse; my $seconds = parse_duration("2 minutes and 3 seconds"); # 123 DESCRIPTION
Time::Duration::Parse is a module to parse human readable duration strings like 2 minutes and 3 seconds to seconds. It does the opposite of duration_exact function in Time::Duration and is roundtrip safe. So, the following is always true. use Time::Duration::Parse; use Time::Duration; my $seconds = int rand 100000; is( parse_duration(duration_exact($seconds)), $seconds ); FUNCTIONS
parse_duration $seconds = parse_duration($string); Parses duration string and returns seconds. When it encounters an error in a given string, it dies an exception saying "Unknown timespec: blah blah blah". This function is exported by default. AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Some internal code is taken from Cache and Cache::Cache modules on CPAN. SEE ALSO
Date::Manip, DateTime::Format::Duration, <http://use.perl.org/~miyagawa/journal/30310> perl v5.10.0 2008-06-02 Time::Duration::Parse(3pm)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy