Re: FTP Macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux