Disclaimer: Use of this script might void your warranty. Or it might not. I’m not really sure.
Just tossing a backup script out there.
I’m using it to perform series of incremental backup, one for each day of the week.
It date stamps the log files too.
notes: My share is named Backups.
Inside Backups are folders named for the day of the week - Monday, Tuesday, etc.
Inside the day-of-the-week folder is a logs folder where the backup logs are stored.
Each log file is named with the date-of-backup.
ie: MyCloud\Backups\Monday\logs\backuplog-03-18-15.txt
Here’s my script:
WEEKDAY=`date +%A`
DATE=`date +%m-%d-%Y`
mount -t cifs -o username=nobody,password= 192.168.10.110:/Data /mnt/mydata
rsync -az --log-file=/DataVolume/shares/Backups/$WEEKDAY/logs/log-$DATE.txt /mnt/mydata/ /DataVolume/shares/Backups/$WEEKDAY/
umount /mnt/mydata
The script copies everything from a share named Data on a remote MyCloud @ 192.168.10.110.
I’m using rsync because it copies across subnets without any trouble.
However , rsync comes with encryption=CPU overhead that severely reduces it’s throughput (for me, to under 10Mbps).
There are faster choices than rsync if both your drives are on the same LAN.
This page discusses how/why rsync can make for a slow copy.
I referenced this page for my date variables.
I hope someone else can make use of it.