I am trying to move uploaded file to another server using scp. following is the script i am using and error;
"mv.sh"
#!/bin/sh
now=$(date +"%y-%m-%d-%M")
cd /var/www/upload
if [ -f /var/www/upload/* ];
then
scp -P 88 * user@192.168.2.1:backup/
STATUS=$?
echo "$now-S1:succesful." >> /var/log/mv_to.log
else
echo "$now-S1:Error!!" >> /var/log/mv_to.log
fi
error;
[: 13: /var/www/upload/1.doc: unexpected operator
If there is only one file it works fine and if there are two or more files it says unexpected operator. Please correct me here.
