An Easier Way To Set Up Time Machine To Back Up To A Networked Windows Computer

Last week I detailed how to set up Time Machine backups to a networked Windows computer that required a lot of somewhat complicated Terminal work. Here's a much easier shell script that'll do the trick nicely.

User sunkid at the InsanelyMac forums put together a shell script that, when run, automates all the steps I detailed in the previous post. A couple of the steps from my previous guide remain the same, so I'll include those steps as-is below. Starting at step three, you'll notice some changes. Here's how it all works:

Step One: Create a Shared Folder on Your Windows Network and Connect to It from Your Mac One nice thing about offloading your Time Machine backups to your Windows computer is that it doesn't need a dedicated drive at all; you just need a folder that you can mount from your Mac.

First, make sure you have sharing turned on on your Windows machine (search "advanced sharing settings" in the Windows Start menu), and make sure the folder you want to use is as your backup is shared. On my Windows computer, the shared folder is at E:Time Machine.

Once it's created, you need to mount the folder from your Mac. To do this, open Finder, type Cmd+K, and enter the smb:// address to your Windows shared folder. On my system, that address looks like this:

smb://Windows/Media/TimeMachine

Windows is the name of my Windows machine on the network, Media is the name of the E: drive, and Time Machine is, of course, the name of my folder. You'll need to enter in your username and password for your Windows machine; make sure you save those to your keychain.

Step Two: Enable Backing Up Time Machine to Unsupported Network Volumes

By default, Time Machine won't write backups to just any network volume. (It prefers you buy a Time Capsule from Apple, I suppose.) Luckily this is easy to get around. You can either fire up Terminal (/Applications/Utilities/Terminal.app), paste the following command and hit Enter:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

...or, if you've installed the very cool Secrets preference pane, you can just fire it up, find the Time Machine section, and tick the checkbox next to Show unsupported network volumes in Time Machine.

Step Three: Download and Run the Time Machine Shell Script

In the previous guide, this step required a bit of Terminal kung fu. Now all you have to do is download this shell script (read more about it at InsanelyMac), open Terminal, cd to the folder containing the makeImage.sh script, and then run the following command:

./makeImage.sh 130 /Volumes/TimeMachine/

Be sure to replace 130 with the size you'd prefer your Time Machine backup to be, and replace /Volumes/TimeMachine/ with the path to the mounted Windows volume you set up above. (Assuming you mounted that Windows share, you can simply type /Volumes/ and press Tab twice to see the mounted volumes on your machine. You should see your mounted Windows folder there.)

Step Four: Backup

If you were able to successfully run the script above, now all you should need to do is open up the Time Machine Preferences, turn Time Machine on, click the Select Backup Disk button, select the mounted Windows Time Machine folder, and click Use for Backup.

As before, whenever Time Machine runs its backups, it'll look for and automatically mount your Windows share, run the backup, and disconnect from the share. If you aren't on your home network, the backup will simply delay until you are.

Some notes: Reader varun suggests that Windows users may need to expand the size of the sparesespan files, which would require making this small tweak to the hdiuitil command in the shell script. This method also adds a XML file to the backup as suggested by reader lee.lawmaster.

[Guide]10.6 (Snow Leopard) Time Machine backup to network share [InsanelyMac]


Comments

    I use sync back for my windows machine as I like the simplicity of it and I know where everything is going. I am only new to mac and don't really understand the benefits of the time machine feature. Can anyone help in naming a simple backup program like sync back for the Mac?

    Basically don't worry about buying any other backup programs for mac, just use Time Machine.

    1. It is free (comes with your computer)
    2. It works & works well

    Even better, if your computer happens to die (or you lose it) you can recover from the Time Machine backup and all your preferences and settings are recovered as well as your files.

    If you receive the message "Permission denied", you probably need to add execute permissions buy running the following command:

    chmod +x makeImage.sh

    and then you'll be able to run the script.

    Might have bitten off more than I could chew with this one. I was hoping I could backup my Air to a partitioned HD attached by USB to a BoB set up as a File Server. I had to search down a simple guide to Terminal ,as I had no idea what "cd to the folder" meant. Finally got the script to run but lots of 'no such file or directory' and "Bad file descriptor".

    As I've already invested 3 hours into this, any suggestions would be most grateful.

    Can anyone help me out with this on 10.8.2? I mounted the folder, ran the script it copied OK, switched on unsupported volumes.

    It copied the files to the share /volumes/OSX/ I can see the files on Windows.

    When I open time machine it just gives me the option of "other time capsule" and nothing else?

    Any help appreciated!

      I need some help here too! Did everything okay, ran the script successfully, but Time Machine STILL doesn't show the shared Windows drive. (I'm on 10.8)

Join the discussion!

Trending Stories Right Now