FTP Macro

Alexander Dalloz alexander.dalloz at uni-bielefeld.de
Mon Oct 25 02:48:44 UTC 2004


Am Mo, den 25.10.2004 schrieb Timothy Payne um 3:34:

> It will log in but not run the commands, I've tried all kinds of changes
> but the samples in my book and on the web say this should work.  I just
> get ftp> after the login and it sits there taunting me.

> Tim...

An example which runs as expected here:

adalloz $ cat .netrc

machine metatron
        login adalloz
        password secret
macdef init
        ls
        pwd
        quit

Keep care the ~/.netrc has chmod 600 and is owned by the user. Keep also
care that the macro definition's last command (here quit) an empty line
is followed. If you then connect running "ftp metatron" it logs in and
automatically runs the define macro called init.

Your code to be in the ~/.netrc:

machine mydomain.com
	login name
	password XXXXXX
macdef macro-name
	cd /backup
	lcd /home/timothy/backup
	put *.gz.gpg
	quit
[comment - not in .netrc: here is an empty line!]

Then run "ftp mydomain.com" and at ftp> prompt execute "$ macro-name".
Voila :)

Alexander



-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 2 (Tettnang) kernel 2.6.8-1.521smp 
Serendipity 04:41:44 up 5 days, 1:21, load average: 0.34, 0.27, 0.30 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20041025/71d61c8a/attachment-0001.sig>


More information about the fedora-list mailing list