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.