The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
quick sed help katrvu Shell Programming and Scripting 3 02-20-2008 11:54 PM
Need quick help SanjayLinux Shell Programming and Scripting 1 09-25-2007 06:36 AM
i need quick help???...please M_Hafez UNIX for Dummies Questions & Answers 3 01-14-2005 04:22 AM
Quick Q, DNS sajjan2 UNIX for Dummies Questions & Answers 1 04-22-2002 09:50 AM
Quick Question Tracy Hunt UNIX for Dummies Questions & Answers 3 02-20-2001 01:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-31-2008
kekanap's Avatar
Registered User
 

Join Date: Sep 2003
Location: South Africa
Posts: 35
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
Reply With Quote
Forum Sponsor
  #2  
Old 01-31-2008
Registered User
 

Join Date: Aug 2007
Location: Bangalore
Posts: 288
xxx_$(date +%D).log

Thanks
Reply With Quote
  #3  
Old 01-31-2008
kekanap's Avatar
Registered User
 

Join Date: Sep 2003
Location: South Africa
Posts: 35
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
$
Reply With Quote
  #4  
Old 01-31-2008
kekanap's Avatar
Registered User
 

Join Date: Sep 2003
Location: South Africa
Posts: 35
help please. Anyone.
Reply With Quote
  #5  
Old 01-31-2008
Registered User
 

Join Date: Jan 2008
Posts: 52
Remove the *

mv nashua* nashua_$(date +%D).log
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0