I haven't used ssh to transfer files, I usually start up an ftp server on my bt box or just mount my windows share using mount -t cifs. I use the mount method to copy my music from my vista machine to bt so I can keep my tunes updated
Here's the script(just edit the vars), it's quick and dirty and definitely could be more secure but here it is:
Code:
#!/bin/bash
# Create Mount
sharepath="//VISTA-01/public/music"
mntpathcmd="/mnt/music/*"
mntpath="/mnt/music"
musicpath="/music"
user=""
pass=""
if [ ! -d "$mntpath" ]; then
echo "Mount path: $mntpath is missing and will be created"
mkdir $mntpath
fi
if [ ! -d "$musicpath" ]; then
echo "Music path: $musicpath is missing and will be created"
mkdir $musicpath
fi
echo "Mounting share: $sharepath to mount path: $mntpath"
mount -t cifs $sharepath $mntpath -o username=$user,password=$pass
echo "Copying update or missing files from: $mntpath to music path: $musicpath"
cp -vru $mntpathcmd $musicpath
echo "Done copying files, unmounting share"
umount $sharepath
echo "Done......"