#!/bin/sh

#######################################################
#
# Rsync が使えない環境での自動リモートコピー用バッチ
#
# expect対話型コマンドでパスワード入力
#
# create by masuda
# create at 2008/04/08
#
#######################################################

HOST=192.168.1.***
UNAME=develop
PASSWD=******
#SOURCE=/home/develop/
#TARGET=/home/hoge/*

# sample cmd
# /home/hoge/bin/this_file.sh SOURCE TARGET

expect -c "
set timeout 20
spawn scp $1 $UNAME@$HOST:$2
expect "password:" ; send "$PASSWDr"
interact
"