- 论坛徽章:
- 0
|
我想把本机的一些数据定时自动传到另外一台机器上备份,我写了以下东东sh,定时让人它自动运行,可不知为什么没用,请各位帮帮忙
fi
FTP_USER="root"
FTP_PWD="111111"
FTP_HOST="192.*.*.*"
FTP_DATA_DIR="/qq/data_bak
STORE_DIR="/root/qq/data_bak"
export FTP_USER
export FTP_PWD
export FTP_HOST
export FTP_DATA_DIR
export STORE_DIR
if [[ "${FTP_HOST}" = " " ]]
then
exit 0
else
cd ${STORE_DIR}
#ls -l ${ ARCHIVE_FILE_BASE } | read ${ LOCAL_LIST }
ftp -n -i -v << ! 2 >&1
open ${FTP_HOST}
user ${FTP_USER} ${FTP_PWD}
cd ${FTP_DATA_DIR}
lcd ${STORE_DIR}
bin
prompt off
mput "36data"`date +%y%h%d`.Z
ssh remote "find . -atime +20 -exec rm {} \;"
bye
!
fi
[ 本帖最后由 8028 于 2007-10-9 16:21 编辑 ] |
|