Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rhett7660

macrumors G5
Original poster
Jan 9, 2008
14,588
4,769
Sunny, Southern California
Hello..


If I want to setup up something that would backup information from my Mac to a specific folder on my windows box how would I go about setting this up.

What I am trying to do is copy a folder that has files xyz. I would like this job to fire off every 3 hours or so looking for changes. I would like those files to be sent to a windows xp box to a specific folder.

I have been reading on this but I am still pretty new to linux and the such and I have a feeling I am over my head.

What I have found deals with backing up from a windows ---> say a NAS box. But not from a Mac-->Windows box. If it is easier from a Mac Mini --> to another Mac Mini.. I just need to be able to move files that have changed say every three hours. Hope this makes sense.

Creating a cronjob or something along those lines?
 
This is the rsync command I use on my Mac Mini to do backups of a drive on my Windows machine,
Code:
sudo rsync -avx --progress /Volumes/Archive/ /Volumes/Archive_bkup
You could then setup a cron job to run every 3 hours.
Code:
export EDITOR=pico
crontab -e
* */3 * * * sudo rsync -avx --progress /Volumes/Archive/ /Volumes/Archive_bkup >/dev/null 2>&1
This will setup the editor for the cronjob to be the pico editor, which is a little easier to use than the vi editor. The 2nd line lets you edit the cronjob. The third sets the command to run every 3 hours. The end of that command has a piece to make sure it doesn't email you after running the command.
 
Thank you for taking the time to respond..

Just to clarify.. is your windows box on a network? Or do you have a shared folder on your Mac?

Thanks

The Windows machine is on my network. I do have to make sure the windows drive is mounted for the Mac to see though, which is just a manner of finding it through Finder. The drive I back up on Windows is set as Shared. The alternative would be to setup SSH on the Windows machine and connect to it using the IP address with the rsync command. That has a different format for the command. It would look more like,
Code:
rsync -avz -e "ssh -i rsync-key" username@192.168.1.25:folder ./local/destination/folder
The rsync-key part is so I can connect without a password. It takes a little setting up to do that. I recommend following a tutorial such as this one if you go down that road.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.