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