首 页文章中心

Linux学习网

您的位置Linux学习网 > Linux企业应用 > 文章内容

linux下ftp脚本下载前一天的日志文件

作者:佚名  来源:不详  发布时间:2007-7-4 8:47:00
脚本如下:

#!/bin/sh
runtime=`date -d "1 days ago" +%Y-%m-%d`
getinfolog() {
cd /usr/local/apache2/logs/info
ftp -n FTP服务器的IP autoftp
user 帐号 密码
ascii
get info-$runtime.acces
get info-$runtime.error
quit
autoftp
}
getinfolog

然后把该脚本加入crontab中。
收藏本页到: 365Key | del.icio.us | | 添加到雅虎收藏+
  • 网站帮助 - 广告合作 - 网站地图