in reply to Net::SFTP mess
If you don't want to use perl modules you probably need to script SCP(1). Here is an edited bit of code from a backup script that should get you started
my $SCP = '/usr/bin/scp'; my $KEYFILE = '/root/.ssh/id_rsa'; my $CVS = "$BACKUP/CVS-$REMOTE_HOST"; my $REMOTE_PATH = "$REMOTE_USER\@$REMOTE_HOST:$REMOTE_PATH"; my $res = `$SCP -o Protocol=2 -i $KEYFILE -c blowfish -B -p $REMOTE_PA +TH $CVS 2>&1`; $res =~ s/[^\n\040-\177]//g; warn $res ? "scp failed and returned:\n$res\n\n" : "scp succeeded!\n\n +";
cheers
tachyon
|
|---|