linux下ftp脚本下载前一天的日志文件
 脚本如下:
#!/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中。
   #!/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中。
相关推荐
  diediexiaomi    2020-08-11  
   杨立峰    2020-08-18  
   wq0    2020-07-18  
   leodengzx    2020-06-28  
   liyansring    2020-06-21  
   jiahaohappy    2020-06-21  
   leodengzx    2020-06-14  
   xsg    2020-06-09  
   piaotiejun    2020-06-07  
   TangCuYu    2020-06-05  
   clmngu    2020-06-03  
   河的第三条岸    2020-05-31  
   atb    2020-05-30  
   书弋江山    2020-05-30  
   LWLWLiang    2020-05-28  
   JJandYY    2020-05-25  
   饮马天涯    2020-05-20  
   wennuanwarm    2020-05-16