Re: howto ftp a file to remote system



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
.



Relevant Pages

  • Re: how to create a string of values that can be used to insert in SQL server
    ... I haven't worked with SQL before, but in the sourcecode below I had to solve ... the problem that I wanted to send some files to a FTP server using ... hab to use a macro. ...
    (microsoft.public.fox.helpwanted)
  • RE: FTP via VBA
    ... way is to use the shell function in VBA to call the command line FTP (not ... the GUI version) to import your files. ... you need a second file called importfiles.cmd with the FTP cammands in, ... I have an Excel VBA macro that basically processes .txt files (runs some ...
    (microsoft.public.excel.programming)
  • Re: Word (program) question
    ... There are instructions in Cheryl's book, and as I said, ... You just have to make sure that the .acl files are named ... some macro being run, then it won't function on the machine. ... Send your autocorrect file to your FTP, ...
    (sci.med.transcription)
  • Re: how to upload a whole directory via FTP?
    ... server of university. ... They only support FTP no sftp... ... I believe init is a special macro. ... If the ftp command finds a $HOME/.netrc automatic login entry for the ...
    (comp.unix.shell)
  • Re: Updating ftp includetext field
    ... using the traditional ftp URL syntax ... > to a file on a remote ftp server. ... Since the macro cannot log on ... the field just has an error message saying ...
    (microsoft.public.word.mailmerge.fields)

Loading