Tuesday, October 22, 2013

Auto FTP logs to server

Below shell script is transferring logs file to server from CMM.
=========================================
Time=$(date +"%F_%HH%MM%SS")
ftp -n <        open
        user
        binary
        prompt
        cd /home/wcsim/dump_062311/cmm1
        mkdir timeoutput_top_error_log_$Time
        cd timeoutput_top_error_log_$Time
        lcd /root
        mput timeoutput*
        mput top_cmm*
        lcd /var/log/cmm/cmm
        mput error.log*
        lcd /tmp/log
        mput shm.debug*
        bye
EOF
rm -rf /var/log/cmm/cmm/*

No comments: