I am trying to move uploaded file to another server using scp. following is the script i am using and error;
#!/bin/sh now=$(date +"%y-%m-%d-%M") cd /var/www/upload if [ -f /var/www/upload/* ]; then scp -P 88 * firstname.lastname@example.org:backup/ STATUS=$? echo "$now-S1:succesful." >> /var/log/mv_to.log else echo "$now-S1:Error!!" >> /var/log/mv_to.log fi
[: 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.