Quick one


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Quick one
# 1  
Old 01-31-2008
Quick one

Hallo friends,

I have a log file called xxx.log which is generated everymorning.
I want to change this file to xxx_[today's date].log

Please assist, i am using ksh on AIX.

Ta,

Pax
# 2  
Old 01-31-2008
xxx_$(date +%D).log

Thanks
# 3  
Old 01-31-2008
Thats how my script looks like. You suggestion didnt work. Any more suggestions?



$ cat mtn_statistics.ksh
#!/bin/ksh
set -x
#########################################################################
#
# Name:
# statistics.ksh
#
# Details:
# Performs a series of queries on the database to analyse application performance;
# reports on backlog of data files. Produces a report for e-mailing to recipients.
# Crontab (non-interactive) invocation.
#
# Usage:
# To compile a number of statistics for MTN and for the SP's
#
########################################################################
# Author:
# Paxley Kekana
#
# Revision History:
# Date Author Details
# 300108 PK First version
# 300108 PK Added ORACLE_SERVER_SID to accomodate SID and
# alias differences
#########################################################################


# Set the ORACLE_SID to ORACLE_SERVER_SID and run script
export ORACLE_SID_BACKUP=${ORACLE_SID}
export ORACLE_SID=${ORACLE_SERVER_SID}
date="1 days" +%Y%m%d

#Scripts are starting to run#
cd /minotaur/Scripts


# /usr/bin/cat <<EOF | $ORACLE_HOME/bin/sqlplus -s /@${ORACLE_SID}
/usr/bin/cat <<EOF | $ORACLE_HOME/bin/sqlplus super_conf/super_conf@pfrd


@nashua.sql
@autopage.sql
@italk.sql
@mtn_sp.sql
@ticket_sp_fraudtype.sql


exit
EOF

cd ../Log
mv nashua* nashua_$(date +%D).log
mv autopage* autopage_$(date +%D).log
mv italk* italk_$(date +%D).log
mv mtnsp.log mtnsp_$(date +%D).log
mv summary_fraud_per_sp.log summary_fraud_per_sp_$(date +%D).log
$
# 4  
Old 01-31-2008
help please. Anyone.
# 5  
Old 01-31-2008
Remove the *

mv nashua* nashua_$(date +%D).log
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Quick question

Hi guys Quick question Im creating an FTP server and im chrooting each user to there home directory blah blah. Ive also setup scponly so there locked etc. Im a novice at unix and have just reaslised the primary group of scponly is the username of one of the ftp users... which im sure... (1 Reply)
Discussion started by: mokachoka
1 Replies

2. Shell Programming and Scripting

Quick question

When I have a file like this: 0084AF aj-123-a NAME Ajay NAME Kumar Engineer 015ED6 ck-345-c 020B25 ef-456-e 027458 pq-890-p NAME Peter NAME Salob Doctor 0318F0 xy-123-x NAME Xavier Arul NAME Yesu Supervisor 0344CA de-456-d where - The first NAME is followed by... (6 Replies)
Discussion started by: ajay41aj
6 Replies

3. Solaris

Quick help!

Hi, iam trying to use lofiadm in solaris 5.10 but getting the following error.. bash-3.00# lofiadm -a /asmdisks/_file_disk1 lofiadm: /dev/lofictl: No such file or directory i dont see lofictl file in /dev .. i checked in other similar machines..i found this file..can i export this file from... (2 Replies)
Discussion started by: rags_s11
2 Replies

4. Shell Programming and Scripting

Need quick help

I have one script that named testing.sh #cat testing.sh #/bin/bash echo "Enter your name:" read name #./testing.sh Enter your name: Sanjay What I need it should take Input in the same prompt(mean to say dun go for next line) like given below. #./testing.sh Enter your name:Sanjay ... (1 Reply)
Discussion started by: SanjayLinux
1 Replies

5. AIX

quick question

Hi, At best I'm a junior admin with a big problem. My developers have got my root password and mgmt insists they need it. I can't even change it when people knowing it leave. I'm certain they've hardcoded it into routines. I've searched my servers and grepped everything & can't find it. ... (5 Replies)
Discussion started by: keith.m
5 Replies

6. UNIX for Dummies Questions & Answers

Quick question

Hello all, Quick question from a fairly new to Unix developer. if then completedLogFile=$logfile.$(date +%Y%m%d-%H:%M:%S) mv $logfile $completedLogFile fi I understand that this portion of code is simply copying a tmp logfile to a completed logfile when a condition is true. The... (2 Replies)
Discussion started by: JohnnyBoy
2 Replies

7. UNIX for Dummies Questions & Answers

quick question

from command prompt I did grep two words on a same line for eg: grep abc | grep xyz and I got tht particular line, but I want to know when I vi that file how to directly search for that particular line? I appreciate if any one can provide answer, thanks in advance (2 Replies)
Discussion started by: pkolishetty
2 Replies

8. UNIX for Dummies Questions & Answers

i need quick help???...please

hey guys i'm new in this world " unix " i wanna any websites can help me to learn unix or any websites i can download UNIX from it thanks :D (3 Replies)
Discussion started by: M_Hafez
3 Replies
Login or Register to Ask a Question