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. I will share a practical script, 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 "> $ path_log cd $ path_all for filename in 'Ls' do ftp-nv $ HOST < > $ Path_log fi d = 'date + % Y-% m-% d _ % H: % M: % s' echo "= $ d = $ path_day = end ============================ ====== ">>$ path_log
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.