Share a practical script and transmit the recordings generated by asterisk to a separate recording storage server through ftp.

Source: Internet
Author: User

Share a practical script to transmit the recordings generated by asterisk to a separate recording storage server through the system cron and transmit the recordings generated every day to a separate recording server, I have been using this script. In the LAN, tens of thousands of recordings are transmitted every day, which can be completed in an hour. I hope it will help you [plain] #! /Bin/bash #2013/4/24-Author: zhangtuo # luckytuo@gmail.com # upload the recordings from one day on the cti server to the ftp server and record the logs # If no parameters are passed, upload the current recording # Call format: # upload the current recording. /ftponeday. sh # upload the recording of the previous day. /ftponeday. sh-1 # upload the recording of a day. /ftponeday. sh 20130423 USER = ftpuser2 # FTP account PASS = zhangtuo123 # FTP password HOST = 192.168.2.247 source/root /. bash_profile path_now = 'pwd' path_log =/var/log/ftp_log.txt echo "================ ==================================== ============================== ">>$ Path_log if [-z" $1 "]; then path_day = 'date + % Y % m % d' elif [["$1" x = "-1" x]; then path_day = 'date-d'-1 days '+ % Y % m % d' else path_day = $1 fi d = 'date + % Y-% m-% d _ % H: % M: % s' echo "= $ d = $ path_day = start ========================== ==== ">>$ path_log path_all =/monitor/$ path_day if [-d $ path_all]; then c = 'LS-l $ path_all | grep "^-" | wc-l 'echo "dir $ path_day file count: $ c" >>> p Ath_log cd $ path_all for filename in 'LS' do ftp-nv $ HOST <! Quote USER $ USER quote PASS $ PASS prompt off bin cd $ path_day LCD $ path_all put $ filename close! Done else echo "file $ path_day bu cun zai"> $ path_log fi d = 'date + % Y-% m-% d _ % H: % M: % s' echo "= $ d = $ path_day = end ============================ ====== ">>$ path_log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.