Re: howto ftp a file to remote system
- From: birre <spamtrap@xxxxxxxxxxxx>
- Date: Wed, 14 Mar 2007 11:01:38 +0100
On 2007-03-14 01:46, Eric wrote:
Can anyone tell me a command line to upload just one file from my local
system to a remote? I'm using gftp-text, but that can change if someone has
a better tool. I need to do this completely *automated* in a script. Also
I dont have ssh capabilities (I wish i did, this would be a snap) so
I'm stuck with FTP
Thanks
Eric
You can create a file with name .netrc in your $HOME.
Then remove permissions for all others chmod go-rwx .netrc (Group Others -)
Now add a tag for each ftp host.
example:
machine thor.somewhere.com login eric password secret
Now you can do things as echo put file.txt | ftp thor.somewhere.com
But you can also add macros to .ftprc
I macro with name init will be run by defaault, example:
macdef init
lcd /local/storage
cd uploads
prompt
mput *
<the macro ends with an empty line>
You can also make a named macro, example index
macdef index
lcd somewhere
cd somewhere
put index.html
now you can make a script that just do
echo \$index | ftp thor.somewhere.com
and index.html will be published.
/birre
.
- Prev by Date: Re: Dell linux survey
- Next by Date: More redundancy for cd images. Use Raid?
- Previous by thread: Dell linux survey
- Next by thread: More redundancy for cd images. Use Raid?
- Index(es):
Relevant Pages
|
Loading