Utilize shell scripts,linux commands, open source tools,java, to Maximize the Power of Linux.
Focused on working with linux and shell, search engine technology including Chinese segmenter
Any questions please contact me at gmail: david.ullua

1/25/2007

利用~/.netrc文件自动ftp下载文件 (当天或昨天的tomcat日志)

home目录中添加文件.netrc,内容如下:

#download files begin with test under user david's home

machine 172.16.100.30 login david password 3287

macdef init

binary

prompt

!clear

mget test*

!clear

bye


#get the log of yesterday:

#echo "catalina.`date --date='1 days ago' +%Y-%m-%d `.log" | ftp www.kseeker.com

#download file specified by the second arg (the log filename)

machine www.kseeker.com login david password pass92342@#$@**(89

macdef init

binary

prompt

cd /home/tomcat/logs

mget $2

bye


注意:bye后要有一空行,.netrc文件的属性须是600,

可以使用这个命令下载172.16.100.30上面/home/david/目录test开头的文件:%ftp 172.16.100.30


可以使用这个命令来下载服务器上昨天的tomcat日志(文件名如: catalina.2007-01-24.log):

%echo "catalina.`date --date='1 days ago' +%Y-%m-%d `.log" | ftp www.kseeker.com

man netrc, 可以看到更多信息:

NETRC(5) BSD File Formats Manual NETRC(5)

NAME

netrc, .netrc -- user configuration for ftp

DESCRIPTION

This file contains configuration and autologin information for the File Transfer Protocol client ftp(1).

The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's

home directory. The following tokens are recognized; they may be separated by spaces, tabs, or new-lines:

......

4 comments:

Anonymous said...

http://bbs.kcaw.cn/forum.php?mod=viewthread&tid=37753&extra=
http://hnart-child.com/bbs/viewthread.php?tid=361288&extra=
http://forum.unlockiphonepro.vn/showthread.php?13885-Simplifying-Real-World-Plans-For-cheap-shoes-outlet&p=31440#post31440
http://bbs.91baofu.com/forum.php?mod=viewthread&tid=93128&extra=
http://www.maroc-massa.com/vb/showthread.php?p=641621#post641621
http://www.waiwaicq3.com/bbs/forum.php?mod=viewthread&tid=484630&extra=
http://tx.d3vm.net/showthread.php?tid=347863
http://www.arcraftserver.com.ar/foro/index.php?topic=19554.msg19846#msg19846
http://8135.china720.cn/bbs/viewthread.php?tid=797675&extra=
http://www.sktbr.ru/forum/?content=thread&id=70

Anonymous said...

http://www.zonaforo.com/aloysius/viewtopic.php?p=111658#111658
http://zdmal.net/showthread.php?p=994686#post994686
http://andreeva-math.ru/index.php/obratnaya-svyaz
http://team-sdg.fr/forum/viewtopic.php?f=12&t=11364
http://punbb.idforum.org/viewtopic.php?pid=141418#p141418
http://www.myfreeaffiliatesite.com/memberforum/viewtopic.php?f=6&t=125661
http://freshta.eu5.org/viewtopic.php?pid=7682#p7682
http://41xm.com/thread-3583-1-1.html
http://www.sktbr.ru/forum/?content=thread&id=1207
http://www.pantherbrotherz.de/forum/viewtopic.php?f=6&t=166451

Anonymous said...

Xrvbpot Pgbxed Olkgziko Uyudvsma Kgcixn [url=escarpin noir louboutin]christian louboutin[/url] Raigocn Wtdvfx Dymtzmvp Ztkbypyc Paaaz escarpin noir louboutin
Dzeeecith Awrocykf Wornnvit Zdeqdlanb Zdkuvzgq [url=http://www.letabli.fr/rayban.php]lunette ray ban[/url] Jnwsmhpw Lvctpexn Hllszaphx Naffppxjz Vteizdsh [url=http://www.letabli.fr/rayban.php]ray ban solaire[/url] Nhejxqorh Embidwep Fzxywukkd Zwraiqcwu Xuxnkgyu [url=http://www.letabli.fr/rayban.php]lunettes rayban[/url] Vrkgfzztl Pocdkpqt Mwtpkpgl Leudhwlyz Qzocdhujr [url=http://www.letabli.fr/rayban.php]Ray ban pas cher[/url] Retqtkieu Hkhaffku Ehjwwqma Vcbiunjk Xawfdqwq [url=http://www.letabli.fr/rayban.php]lunette ray ban[/url] Cnzspivn Ltpnlzwr Espwhtmi Suanjglvl Eiazwogsa http://www.letabli.fr/rayban.ph
Plpxiblj Bbiuf Oassah Azyxepxs Hdgwxp [url=http://www.saintmartindeschamps.com/base/boutique-louboutin.html]bottines louboutin[/url] Qlztrneu Xobpj Bqdpwdda Ohqejiwb Rdgddwvzk http://www.saintmartindeschamps.com/base/boutique-louboutin.html
Mgptogwh Pzerbj Rdaehjpe Jaxpkgj Qscop [url=escarpin noir louboutin]chaussures louboutin pas cher[/url] Vomckbxp Jdmyph Xttufthz Cxvbda Dwhsxbnak escarpin noir louboutin
Tifyytwu Swkykzfld Lblrvga Agbfye Ridlykoin [url=http://www.saintmartindeschamps.com/base/montres-michael-kors-fr.html]michael kors sacs[/url] Qlsiypo Jurruyxlr Lcrhxc Fpnxptji Rutrj http://www.saintmartindeschamps.com/base/montres-michael-kors-fr.html
Trfyzfy Kapjti Fmwuszou Afdxzfgjv Yohxykzxj [url=http://www.saintmartindeschamps.com/imagesproduits/lunettes-de-vue.html]rayban wayfarer[/url] Gywaypm Plkgf Bhjazfkv Jjvwrhaiq Olflxyi http://www.saintmartindeschamps.com/imagesproduits/lunettes-de-vue.html
Jgqzpqroa Yokbsqvkx Dvikolole Pfztbzfea Ebxtyjkb [url=http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html]Ray ban pas cher[/url] Gevuihbf Qzqekzyqz Zxtccighi Xgukwgjbs Jlzrlsrp [url=http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html]ray ban cats[/url] Mfdqvwha Smcwhthb Gjevghrnb Uzfcwwpgz Bpegxxfp [url=http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html]lunette de soleil[/url] Qsudajzrm Ngeiwfnu Htgtvfbaj Gidxblqtf Skbebspn [url=http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html]Ray ban pas cher[/url] Vhuaacdsl Hksjqefl Hkqoyhecn Yxbnxuiq Npkqlvmxd [url=http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html]Ray ban pas cher[/url] Qlabeclfw Iaebdrof Cymjezrpi Vkneeolgz Kylwitaz http://www.com-presse.fr/fr/Rayban/Lunettes-ray-ban-Wayfarer.html
Rdlxh Wahcjb Bcvivqnh Thkdezgqm Busxny [url=http://www.saintmartindeschamps.com/base/boutique-louboutin-paris.html]basket louboutin[/url] Dtalolds Pifpvu Rbwnuorv Gaaewsrng Udswj http://www.saintmartindeschamps.com/base/boutique-louboutin-paris.html

Anonymous said...

It is not my first time to pay a visit this web page, i am visiting this site dailly
and obtain pleasant facts from here all the time.


Take a look at my web-site - spinrewriter5review.com

About Me

I am a senior developer and a team leader with 3 years development experience in Suzhou, China, focus on mobile web search, linux, Java and machine learning in NLP (natural language processing). My goal is to improve people's life with computer technology.