You can also use a semicolon between the commands. The difference between that and the double ampersand is that the 2nd command will only execute after the first command completes successfully.
------------------------------------------------------------ <>< 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 11:32 AM, Jeremiah Bess <[email protected]>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 > -- <>< 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
