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
