Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SFTP as a background job

Status
Not open for further replies.

minus0

Programmer
Feb 20, 2003
73
US
Hello all,

I have a rather large file (~15 gigs) to be transferred from one environment to another - Is it possible to SFTP files as a background job? I tried doing a put file1 target\file1 &, knowing it wouldn't work but ...

Thanks in advance.
 
How about this:

Code:
cd /destination_dir
ssh source_machine 'cd /source_dir ; find . -print | backup -iqf -' | restore -xqvpf - &

Regards,
Khalid
 
Hi

or you could create a script to sftp the file , run script as batch job

e.g.

DET=$(sftp $REMUSER@$REMHOST 2>${ERR} << EOD
cd $FTPDIR
put ${SOURCEFILE}
exit
EOD
)
 
Thanks Khalid, DSMARWAY for your suggestions - these are definitely options that can be considered but my question was more to do with if a SFTP file1 & is possible like how one would do a cp file1 file2 &

Thanks
John

 
I'm not sure why you want SFTP! You can use so many commands like scp or the combined command i suggested above!

I know that if you wnat to automate the ftp (or sftp) you have to use the .netrc file:


Have a look at this link for a procedure to copy files using rcp of ftp (which is applicable to sftp):


Regards,
Khalid
 
Thanks khalidaaa for your suggestions. Why do I use SFTP - no choice but to use SFTP, directive from the security folks at work. Using .netrc - yes I am familiar with this and have used it before. I have now come to the conclusion that its not possible to do an SFTP & so giving up on this and instead going back to doing the transfer via either SCP or SFTP in a script.

Thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top