The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script for automatic deletion of old files vivek_scv Shell Programming and Scripting 4 09-08-2007 10:57 PM
Automatic Log files to my E-mail. adel8483 SUN Solaris 2 04-10-2007 01:10 AM
transfering files unix to pc intern UNIX for Dummies Questions & Answers 8 05-30-2006 02:35 AM
Transfering files from one server to another. Alan Bird UNIX for Dummies Questions & Answers 4 09-18-2003 01:24 PM
Transfering files vbs UNIX for Dummies Questions & Answers 5 06-25-2002 08:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2006
Registered User
 

Join Date: Jun 2006
Posts: 1
Stumble this Post!
automatic transfering of files using scp

I'm in the process of writing a shell script with copies files from one linux box to another using scp. I wish to run this through a cronjob so it cannot be interactive.

This is what I have so far.

#!/bin/sh
PASSWD='passswd'
dateset=$( date | awk '{print $2 $3 $6}')
for dates in $dateset; do
dateset2=$dates
done
cd /home/user
scp -r user@host:/home/user/$dateset2.db.gz . << END_SCRIPT
quote PASS $PASSWD
END_SCRIPT
exit 0

it still asks me for the password though.

It works if I use ftp (but I'd rather use something more secure)

Might anyone be able to offer suggestions?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-22-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
Stumble this Post!
I don't think that scp/ssh/sftp family works with a HERE doc. You would have to setup public key authentication between the two systems. You can search the site for details on how to do that. Search for public key authentication on the forums.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0