#!/bin/sh
FTPHOST="1.2.3.4"
USERNAME="bsdlover"
PASSWORD="bsdlover"
#ftp服务器的地址、ftp用户的用户名、密码
BackupPath=/tmp/bakcup/
#在哪个目录生成压缩文件
BACKUPDIR="logbak"
#ftp登陆以后,相对于根目录的存放压缩文件的目录
cd $BackupPath
LogFile=$( +%y%m%d).tar.gz
tar zcvf $LogFile /var/log
ftp -n << EOF
open $FTPHOST
user $USERNAME $PASSWORD
cd $BACKUPDIR
put $LogFile
quit
EOF
==================================================================================
M2-XD-IST1:/home/wangss>more /home/scripts/ftpstatus.sh
{J3WZp{0#!/bin/sh
"i[z#Bma#}To0export LANG=en_USITPUB个人空间sT%fw`5I
m!T-bf T
CURDATE=`date +%Y%m%d`
.]g-l7ykeyL0F_NAME=svrstatus_ist1.$CURDATE
|"}d5{8[Z,u9X%T?0ITPUB个人空间_ a*]$I5R7@
cd //log/report/svrstatusITPUB个人空间Z,g*x8yg&S:EA
ITPUB个人空间
w8^#u
Qp*F&|*k
ftp -n 192.168.1.1 << EOFFTP
E|0uD'ZPI/ZP
阅读(640) | 评论(0) | 转发(0) |