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

NAME
lprm -- remove jobs from the line printer spooling queue SYNOPSIS
lprm [-Pprinter] [-] [job # ...] [user ...] DESCRIPTION
The lprm utility will remove a job, or jobs, from a printer's spool queue. Since the spooling directory is protected from users, using lprm is normally the only method by which a user may remove a job. The owner of a job is determined by the user's login name and host name on the machine where the lpr(1) command was invoked. Options and arguments: -Pprinter Specify the queue associated with a specific printer (otherwise the default printer is used). - If a single '-' is given, lprm will remove all jobs which a user owns. If the super-user employs this flag, the spool queue will be emptied entirely. user Cause lprm to attempt to remove any jobs queued belonging to that user (or users). This form of invoking lprm is useful only to the super-user. job # A user may dequeue an individual job by specifying its job number. This number may be obtained from the lpq(1) program, e.g. % lpq -l 1st:ken [job #013ucbarpa] (standard input) 100 bytes % lprm 13 If neither arguments or options are given, lprm will delete the currently active job if it is owned by the user who invoked lprm. The lprm utility announces the names of any files it removes and is silent if there are no jobs in the queue which match the request list. The lprm utility will kill off an active daemon, if necessary, before removing any spooling files. If a daemon is killed, a new one is auto- matically restarted upon completion of file removals. ENVIRONMENT
If the following environment variable exists, it is utilized by lprm. PRINTER If the environment variable PRINTER exists, and a printer has not been specified with the -P option, the default printer is assumed from PRINTER. FILES
/etc/printcap Printer characteristics file. /var/spool/* Spooling directories. /var/spool/*/lock Lock file used to obtain the pid of the current daemon and the job number of the currently active job. DIAGNOSTICS
``Permission denied" if the user tries to remove files other than his own. SEE ALSO
lpq(1), lpr(1), lpd(8) HISTORY
The lprm command appeared in 3.0BSD. BUGS
Since there are race conditions possible in the update of the lock file, the currently active job may be incorrectly identified. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy