Re: Transfert file with scp (ssh)
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Fri, 9 Nov 2007 14:00:48 -0500
On 2007-11-09, Claudio wrote:
On 2007-11-08, Rahan <Rahan@xxxxxxxxx> wrote:
Every day, i need to transfert 1 file from one to another solaris server
by using scp (ssh).
i am looking a script or an exemple of the script to do it by first
checking the presence of the file, and then, transfert it and
re-transfert it if the transfert fails for some raison like a network
problem or remote host down.
<untested>
scp file remote-machine:path/
while [ $0 -ne 0 ]; do
sleep 60
scp file remote-machine:path/
done
</untested>
I think it's understandable. $0 is the return value of the
last command. By convention, it equals 0 if everything was ok.
I think you mean $? not $0.
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- Follow-Ups:
- Re: Transfert file with scp (ssh)
- From: Claudio
- Re: Transfert file with scp (ssh)
- References:
- Transfert file with scp (ssh)
- From: Rahan
- Re: Transfert file with scp (ssh)
- From: Claudio
- Transfert file with scp (ssh)
- Prev by Date: Re: Transfert file with scp (ssh)
- Next by Date: Re: Transfert file with scp (ssh)
- Previous by thread: Re: Transfert file with scp (ssh)
- Next by thread: Re: Transfert file with scp (ssh)
- Index(es):
Relevant Pages
|
|