trying to automate back up scripts using cygwin and crontab.
the script works perfectly when i run it manually. but when i cron it
it only runs part of the script .
Code:
#!/bin/sh
# This shell script file backs up the data from SHARE
# -------------SCRIPT VARIABLES---------------
SHARE="//server/myshare";
DATADIR="myshare";
USERNAME="boggle" #or notneeded
PASSWD="mypass";
BACKUPFILE="myshare";
#BACKUPDRIVE="/dev/hdc1";
BACKUPMP="/cygdrive/d/cacheback/";
SMBMP="/mnt/smb/";
# ---------------------------------------------
export PASSWD;
echo 'go------------------------------------------------------------------';
date;
mount -f $SHARE $SMBMP ;#password=$PASSWD username=$USERNAME;
if (ls $SMBMP) then #removed $DATADIR
echo "Backing up $SHARE";
cd $SMBMP;
rsync -vur $SMBMP $BACKUPMP$DATADIR/;
cd /;
fi;
umount $SMBMP;
when run from cron i only get it printing out go and the date and time
it cant do the mount jobs?