zhentyn

FTP与WGET自动备份脚本

FTP脚本
先建立abc.bat与ftp.dat文件
abc.bat内容:
ftp -n -i -s:ftp.dat

ftp.dat文件

open 210.192.111.98
user username password
get yuesai.rar
get chinainteractive.rar
disconnect
bye

其中get 某个文件用get filename
取得该目录下的全部文件用mget *.*

如下是一些时间参数。
date:~4,4%%date:~9,2%%date:~12,2%-%time:~0,2%



Wget脚本

首先从http://users.ugent.be/~bpuype/wget/网站上下载wget工具


help for wget

Basic options

Display all help: wget --help

Completely mirror a site: wget -mr http://...
-m: mirror
-r: recursive
Mirror without following links to other servers, parent directories: wget -mrnp http://...
-np: no-parent

Retrieve a html file and convert relative links to absolute ones: wget -k http://users.ugent.be/~bpuype/wget
-k: 'k'onvert links

Resume partially downloaded files (if supported by the server): wget -c http://...
-c: continue

Read url's from a file and retrieve them: wget -i file_with_urls.txt
-i: input-file
Ask for url's (read from stdin): wget -i -. Enter url's on the command line, press enter after each url, and terminate with ^Z (press CTRL-Z) on an empty line.

FTP

--glob=off
Don't treat (, *, ? etc. as globbing characters. Use when transfering files with names that contain these characters.

--passive-ftp
Use passive mode for data connection (try this if you're behind a firewall, NAT box...)

Proxy

To make wget use a proxy, you must set up an environment variable before using wget. Type this at the command prompt:

set http_proxy=http://proxy.myprovider.net:8080

...where you use the correct proxy hostname and port for your ISP or network. You can use ftp_proxy to proxy ftp requests.

--proxy=on
--proxy=off
Turn proxy usage on/off once variable is set.

posted on 2006-04-30 12:25 果园 阅读(859) 评论(0)  编辑 收藏 引用 所属分类: WINDOWS

只有注册用户登录后才能发表评论。