Bill,

I would alternately suggest using scp - which is a feature of ssh - instead
of ftp.  scp is basically ftp done right from a security standpoint.  It
passes all communications through an encrypted pipe.  The advantage to this
is that your password is not sent down the wire unencrypted.  It comes
packaged with the ssh client.  You would need an ssh server running on the
server.  The syntax is 'scp <source file>
<u...@ip_address/path/to/directory>'.
You can also use it in reverse to download a file from the server to the
machine you're working on - 'scp <u...@ip_address/path/to/file>
<download_location>'.  Check the scp man page for other options.

HTH,
------------------------------------------------------------
<><  Scott Vargovich  <><
------------------------------------------------------------
~~~OpenPGP Key ID: F8F5DC7E~~~
------------------------------------------------------------

><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>¸.
·´¯`·.¸. , . .·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>

Chat Google Talk: [email protected] Y! messenger: airpath_scottv MSN:
[email protected] AIM: Airpath ScottV
Contact Me [image:
Facebook]<http://www.facebook.com/tonyaw?v=wall&story_fbid=113208095380521#%21/?ref=home>[image:
Twitter] <http://twitter.com/bluesfreak72>

--- @ WiseStamp
Signature<http://my.wisestamp.com/link?u=y9hmyrgkp2n9b94h&site=www.wisestamp.com/email-install>.
Get it 
now<http://my.wisestamp.com/link?u=y9hmyrgkp2n9b94h&site=www.wisestamp.com/email-install>


On Tue, Jun 1, 2010 at 1:32 PM, Bill Oliver <[email protected]> wrote:

>
> Thanks, but I don't understand.  The ftp command is a "put" from the
> outside (client) machine, using .netrc.  The cp command is on the receiving
> (server) side.  I don't see how to run the cp command from the ftp client.
>
> I guess I could do it as a pull from the receiving side which would make
> the recipient machine the client, but that wouldn't solve the problem
> because the ftp would then "get" an incomplete file if it were still being
> written to disk on the server.
>
> Or are you saying there's a "cp" command in ftp?  I couldn't find it.
>
>
> However... After a quick search of the intertubes, it was pointed out that
> ftp *does* have a "rename" function.  Thus, one can put the file to
> xxx.incomplete, and then rename it to xxx.jpg upon completion.  The script
> on the recipient side then will not work unless the complete file is
> present.
>
> Thus my .netrc file looks like:
>
> machine <blog machine> login <userid> password <password> macdef
> init
> cd /picdir
> prompt off
> put tmp.jpg tmp.part
> rename tmp.part tmp.jpg
> quit
>
>
> That seems to work...
>
> billo
>
>
>
>
> On Tue, 1 Jun 2010, Jeremiah Bess wrote:
>
>  Combine the ftp and copy commands in a single script, and use a
>> double-ampersand &&. This will run the second command only after
>> the first has been completed successfully.
>>
>> ftp <insert your commands> && cp <insert your commands>
>>
>> Jeremiah E. Bess
>> Network Ninja, Penguin Geek, Father of four
>>
>>
>> On Tue, Jun 1, 2010 at 09:16, Bill Oliver <[email protected]> wrote:
>>
>>      I have a webcam set up at a distant location.  It ftps my server an
>> image every minute.  I have a script set up that
>>      copies the image to an archive and to a web page, e.g.
>>
>>      #!/bin/sh
>>      cp tmp.jpg archives
>>      cp tmp.jpg /var/www/blog/pics
>>
>>
>>      This runs into a synchronization problem as you might expect --
>> sometimes the file gets copies before the ftp is
>>      finished, resulting in an incomplete picture being archived.
>>
>>      Is there an easy way to test to see that an ftp has completed?  I
>> could run a look looking at changes in filesize, I
>>      suppose, but it seems there should be a more elegant way...
>>
>>      Thanks!
>>
>>      billo
>>
>>      --
>>      You received this message because you are subscribed to the Linux
>> Users Group.
>>      To post a message, send email to [email protected]
>>      To unsubscribe, send email to
>> [email protected]
>>      For more options, visit our group at
>> http://groups.google.com/group/linuxusersgroup
>>
>>
>> --
>> You received this message because you are subscribed to the Linux Users
>> Group.
>> To post a message, send email to [email protected]
>> To unsubscribe, send email to
>> [email protected]
>> For more options, visit our group at
>> http://groups.google.com/group/linuxusersgroup
>>
>>
> --
> You received this message because you are subscribed to the Linux Users
> Group.
> To post a message, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit our group at
> http://groups.google.com/group/linuxusersgroup
>



-- 
<><  Scott Vargovich  <><
------------------------------------------
OpenPGP Key ID: F8F5DC7E
------------------------------------------

-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup

Reply via email to