I’d like to use my Linux all-in-one machine to back up important files from the various Windows machines on my network.
For a while I shared out the Windows drives with a password and ran a custom script that smb-mounted them, then ran rsync to back up the files, but I’m thinking there’s something better.
I think my ideal solution is something like a windows client that creates a custom script so only the files you want get backed up, or perhaps connects to some server process itself. I’m not really sure.
This is sounding more like IMHO material now, but I’ll ask my question anyways: Does anyone know of a better way to back up files from Windows to a Linux box?
(Here’s my lame script if anyone wants to see it:
#Mount the directory....
smbmount //WinBox1/c /home/backup/mount-WinBox1 -o credentials=WinBox1.credentials
#Then use rsync
rsync -arltp /home/backup/mount-WinBox1 /home/backup/WinBox1-rsync
smbumount /home/backup/mount-WinBox1
Dunno; that sounds pretty good to me; the server is in control of the actual copying process, so you have the success/failure results on-hand, plus rsync is a pretty powerful tool compared to most options you’ll have if you’re copying from the Windows end.
If you do it from the client end and
-the client process can’t copy a file for some reason
-the network connection cannot be established, or fails mid-way
-the client machine is not switched on at the scheduled time
how will the server know that something went wrong?
Well, if there exists software that does what I listed, then they’d have taken care of it already.
I’m not adverse to the server controlling the process - I think the biggest reason I didn’t just use that script in a cron job was that I didn’t want to back up entire drives, just certain files and directories. Having the client generate a list of these file (perhaps constructing an rsync script itself) would mean my 120G backup drive didn’t get full of backups of installed games and such.
I guess if I clean up my directory structures and think about it a bit, what I have now could work ok.
Personally, I would setup sshd on each of the windows machines with cygwin. In fact, that is what I have done in a couple similar situations. But truth is, I can’t see a huge advantage of doing that over doing an smbmount. Mainly that being able to ssh into any of the machines in your environment is useful in many ways, but there’s no real advantage if your sole goal is backup.
It should be fairly easy to backup specific files and directories. One simple solution is to put a file with a common name on each of your windows machines, and then use the “–include-from” option.
Do you have an rsync component running on your Windows PC?
If not, then your script is not utilizing the power of rsync. Without rsync on your Windows PC, your Linux PC is processing every file in your share to see if it needs to be copied–essentially moving the same amount of data across the network as a copy, and eliminating the benefits of rsync.
You’d be better off configuring rsync on the Windows PC using cygwin. Then, you can run the rsync script from Linux (without mounting the Windows hard drive), and rsync will only copy over the parts of the files that changed since the last sync.
Here is a decent article describing different ways this can be done.