红联Linux门户
Linux帮助

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

发布时间:2007-07-03 00:55:05来源:红联作者:MPiops
脚本如下:

#!/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中。
文章评论

共有 1 条评论

  1. 1473131333 于 2013-04-07 21:42:56发表:

    可以吗