- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Append date with time to stdout
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2012 09:36 AM
04-25-2012 09:36 AM
Hi All,
I am using following shell script to verify database run , also , I need to create a logfile , everytime it is kicked-off . we do use control-m to kick off jobs. The problem , I have , when I run this, the script will only add "success" to logfile, what i need to do is also add timestamp before the success. please advise on this.
#!/usr/bin/sh . qa02 SID=ptmtrain export DATE=$(date +m%d) LOG_DIR=/home/oraadmin/test/dev_monitoring/logs LOG_FILE=${LOG_DIR}/${DATE}.log typeset -i mHHMM=`date +%H%M` typeset -i mDD=$(date +%d) mDay=`date +%a` echo "select 'success' from dual;" | sqlplus -s oramonitoring/temp123@$SID | grep success >> $LOG_FILE if [[ $? -ne 0 ]]; then echo "$SID is down, pleae look into this" | mailx -s "$SID has issue , please look into this" aajitkumar@csc.com fi else : fi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2012 02:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2012 06:42 PM - edited 04-26-2012 07:18 AM
04-25-2012 06:42 PM - edited 04-26-2012 07:18 AM
Re: Append date with time to stdout
If you want the date in your file, just put it there:
date >> $LOG_FILE
>echo ${mDay} >> ...
This only has the day of the week.