Re: Checking success of automated scp

From: Nico Kadel-Garcia (nkadel_at_comcast.net)
Date: 07/28/04


Date: Wed, 28 Jul 2004 08:14:16 -0400


"Doug O'Leary" <dkoleary@olearycomputers.com> wrote in message
news:1lMNc.35$fi.22@fe07.usenetserver.com...
> In article <caad9b27.0407271249.194b6237@posting.google.com>, PullnOutHair
wrote:
> > I am utilizing scp with a public/private key pair to automatically
> > transfer files every night as a method of backing up my system. I get
> > this to work utilizing a bash script on my linux machine that runs
> > once a day, and performs a simple scp to a host server. Is there a
> > way that I can check for the success of the scp transfer inside the
> > bash script to see if I should retry?
>
> if [ $? -eq 0 ]
> then
> echo "Everything's good"
> else
> retry
> fi

And save yourself bandwidth: use "rsync -e ssh -aH --delete" instead, in
order to not duplicate unmodified files, duplicate hardlinks, and delete
files that have been deleted on the master.