#!/usr/bin month=`date -d yesterday +%m`; day=`date -d yesterday +%d`; filename=klog`expr $month - 0`-`expr $day - 0`*.txt; echo "I will get the data($filename) from ftp server..."; echo "---------------------------------------------------"; ftp -i -n IP地址 << FTP user FTP用户名 FTP密码 bin cd /test/web/record lcd /home/hpflow/backupdata/record mget $filename quit FTP echo "-------------------------------------------------"; echo "get the data done!"; echo "Now insert the data to the database..."; cd /home/hpflow/backupdata/ 这个脚本可以在LINUX 的crontab 里面设为定时执行