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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What's The Easiest Route To Creating A Unix Executable File for Terminal? unimachead OS X (Apple) 10 11-03-2008 12:40 PM
How to debug to a file? Ant1815 UNIX for Dummies Questions & Answers 2 05-28-2008 10:42 AM
How to debug C source file using GVD debugger argupta High Level Programming 2 10-06-2005 10:14 PM
Easiest way to cat out first 100 lines of a file into a different file? LordJezo UNIX for Dummies Questions & Answers 1 06-14-2004 09:40 AM
How to debug a shared library(.so file) on AIX? AlbertGao AIX 1 12-25-2003 11:28 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-15-2006
LordJezo
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Easiest way to send output to a debug file?

I have this in my script:

Code:
DEBUG_DIR=/log/rotate_output
DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP}


SERVER_FILE_LIST="\
wasint0206  /logs/squid_backup
wasint0201  /logs/squid_backup"


/usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY
do
    cd /log/squid_logs/${SERVER}
    rm /log/squid_logs/${SERVER}/access.log
    /usr/local/bin/scp  ${SERVER}:${DIRECTORY}/access.log.${TIMESTAMP}-12AM.gz log/squid_logs/${SERVER}
    /usr/bin/gunzip /log/squid_logs/${SERVER}/access.log.${TIMESTAMP}-12AM.gz
    /log/squid_logs/convert.sh /log/squid_logs/${SERVER}/access.log.${TIMESTAMP-12AM >> /log/squid_logs/${SERVER}/access.log.${TIMESTAMP}.convert
    /usr/bin/gzip -f /log/squid_logs/${SERVER}/access.log.${TIMESTAMP}.convert
    rm /log/squid_logs/${SERVER}/access.log.${TIMESTAMP}-12AM
done
How would I get all the output from that do loop to go to the debug file that I set up at the top? I know I could put a > ${DEBUGLOG} at the end of every line but is there an easier way to do it? Is there a way to create a dated output file from the crontab? That way the whole program could be done in one shot.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0