Code:
#!/bin/bash
umount /mnt/2k 2>/dev/null 1>/dev/null
mount -t smbfs //winbox_name/share /mnt/2k/ -o username=administrator,password=pass
if [ ! -d /mnt/2k/backup ] ; then
echo " cannot erach the backup dir on network drive" >/root/script-logs
echo " directory might be deleted or cannot mount network drive" >>/root/yedek-scripts/script-logs
umount /mnt/2k 2>/dev/null 1>/dev/null
exit 0
fi
DATE=$(date +%d.%m.%Y-%H.%M)
echo "DATE:$DATE">>/root/script-logs
echo "-------------------------------------------------------------">>/root/script-logs
cp -R /path/to/backup/* /mnt/2k/backup 1>>/root/script-logs 2>>/root/script-logs
umount /mnt/2k 1>>/root/script-logs 2>>/root/script-logs
this is very simple script. because it just copies files to windows share. u will probably want to delete older files keeping last 7 one or more and compress the files to save the disk space.
if u want let me know pls
u can use cron to shedule the task. the following example will run /root/script file at 00:20 everyday:
#crontab -e
20 00 * * * /root/sctript.sh
good luck