Success #3 rsync backup between My Cloud devices

WD went to a lot of touble to make backing up between My Cloud devices really simple and robust.

But I am paranoid for a living and I won’t put sensitive data into a public cloud.

I did some digging around and found that rsync is native to My Cloud’s Debian build.

I came up with a fairly simple backup script. 

I use it to backup over OpenVPN, where the data source and destination are on different network subnets.

First:

I made a Backup script to mount the remote share -> perform rsync -> unmount the share

Assuming your share name is mydata and your source data is at 192.168.1.110

Run the following command

mkdir /mnt/mydata

next

save the following as /usr/local/backupmydata

mount -t cifs -o username=nobody,password= 192.168.0.110:/mydata /mnt/mydata
rsync -az /mnt/mydata/ /DataVolume/shares/mydata/
umount /mnt/mydata

next change your script permission, so it is executable

Run the following command

chmod 777 /usr/local/backupmydata

Next Create the cron job

Run the following command

echo 00 19 * * * root /usr/local/backupmydata > /etc/cron.d/backupmydata

 (this runs the backupmydata script at 19:00 hours each night)

Alternately:

That last step could also be accomplished by running

nano /etc/cron.d/backupmydata

and inserting the following line into the file

00 19 * * * root /usr/local/backupmydata

I don’t know if I had to reboot afterward but I did.

I got the Cron edit info from this post

http://community.wd.com/t5/WD-My-Cloud/Guide-Cron-and-opendns/m-p/771267/highlight/true#M18736

edit: removed unneeded comments, corrected script typo, added alt method to create cron file

2 Likes

Hello,

Thank you for sharing this information.

Hi,

Thank you for shareing :slight_smile: :) 

Is there a way to see the rsync progress ?

Thank you in advance,

Itai.

you should be able to modify his rsync command as below to see progress while its running

rsync -az --progress /mnt/mydata/ /DataVolume/shares/mydata/
1 Like

Thank you for this post.

It got me thinking in the right direction for automating a backup solution between two MyPassportWireless devices.

I shared my solution here:  http://community.wd.com/t5/My-Passport-Wireless/Backing-up-between-two-My-Passport-Wireless-devices/td-p/811481

I’m not sure if  doing the rsync over cifs or doing it via ssh is faster. I would try to compare, but for some reason I can’t mount the one drive to the other via cifs/smb. If you have any ideas/insights, I’d appreciate it.

—Kayvan