Mac users are familiar with Time Machine! In case you got no idea what’s Time Machine, it’s a backup software which is available by default on all Mac systems. If I’m wrong on that, at least Time Machine has been available on my Mac without any additional installation right off the bat — it was available when I first purchased my Mac. Time Machine is a very good backup software since it’s remembering the changes within your file system. For an example, you have 40 GB data worth to be backed up, but halfway through, your Mac got shut down from a power outage; don’t sweat young, brave Jedi, because when you fire up the Time Machine again at anytime after the power outage incident, the Time Machine automatically picks up where it had left — it means instead of backing up the whole 40 GB data worth over again, Time Machine just have to back up whatever files that had never been backed up before (it also works for files that just recently have changed such as new data).
OK, Time Machine is great, but the software itself is useless unless you have a hard drive either external one or the internal one to be made available somewhere on your network or localhost so the files can be copied over from mac for backups. A major drawback for Time Machine is that if an external hard drive or internal hard drive is not connecting to another Mac system, Time Machine won’t recognize the available backup drive(s). There is a workaround for this! Some people have expertly configured Samba on a Linux machine to allow Time Machine to work this way.
Unfortunately, I don’t know how to make Samba works with Time Machine, and so I resort to another method! This method is just as good which utilizes the AFP system which is also known as AppleTalk Filing Protocol. To be even more specific, I know how to make AFP works with Time Machine using Ubuntu 10.10! I don’t think it’s that much of a different if you’re using Ubuntu 10.04 (an earlier version) — it should work for you if you’re using Ubuntu 10.04 instead of Ubuntu 10.10.
Before taking on this adventure, you need to make sure you’re comfortable with pasting command lines into a terminal inside Ubuntu, editing files (that’s, configuration files) of various applications in terminal using vim.tiny or vi or pico or nano, opening new ports inside the firewalls (cannot show you how to do this as it’s beyond the scope of this article, and if you have both firewalls on Mac and Ubuntu — you know the deal), and starting and stopping services on Ubuntu. Now you have been warned and informed of the important details, let get started!
1) Either ssh into your Ubuntu 10.10 or log onto Ubuntu PC physically, open up a terminal and type in this command “sudo aptitude install netatalk“ without using the double quotes. In case you don’t know, Ubuntu 10.10 stops shipping Aptitude by default (as in out of the box), therefore you need to install Aptitude before you can execute the previous command. To install Aptitude, just type in “sudo apt-get install aptitude” without the double quotes.
2) Open up /etc/netatalk/AppleVolumes.default with vim.tiny or nano or pico or vi, and then enter /your/path VolumeName allow:@groupname options:usedots,upriv,tm allowed_hosts:x.x.x.x(x stands for IP address of the Mac machine that need to be backed up) at the end of this file.
3) Restart the AFP service on Ubuntu by typing in this command “sudo /etc/init.d/netatalk restart” without using the double quotes.
4) Avahi Daemon and Libnss-mdns should be installed on Ubuntu 10.10 by default. But if these packages aren’t yet installed, you need to install these applications using the command line “sudo aptitude install avahi-daemon libnss-mdns” without using the double quotes.
5) Open up the file /etc/nsswitch.conf and add “mdns” at the end of the line which looks like this (hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns).
6) Let add a XML configuration file to AFP so Ubuntu will broadcast the AFP service to any Mac that wants to use the service. By doing this, your Mac will see the available drive(s) for the Time Machine to use. So, change directory into /etc/avahi/services/ and create a new file with the name of afpd.service. Use vim.tiny or whichever file editor you like and open up the file /etc/avahi/services/afpd.service and enter the configuration below:
<?xml version=”1.0″ standalone=’no’?><!–*-nxml-*–>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
Just make sure you remember the port number so you can open up the same port number in your firewall — in the case above, the port number is 548. The part where it says <txt-record>model=MacBookPro</txt-record>, you can modify “model=MacBookPro” into the type of Mac machine that you’re using. For an example, if you’re using other than MacBookPro, then you should enter one of these: Macmini, iMac, MacPro, Xserve, MacBook, or MacBookAir.
7) Lastly, let restart your Avahi Daemon by typing in the command “/etc/init.d/avahi-daemon restart” without using the double quotes. To be extra careful, you can always restart your Ubuntu and your Mac. Don’t forget to launch your Time Machine so the backup process can begin! Time Machine will ask you to select a Volume, but you already know the Volume you want right? Remember when you have to configure the file /etc/netatalk/AppleVolumes.default? If you do, then you also remember the command line you entered — the part where it says VolumeName, you can basically make up any name for the VolumeName. This is where also the part you have to rename the @groupname with the group of the user that owns the directory on Ubuntu where Time Machine will copy the backup files onto it.
Additional tips: When things are not working out, make sure you check your Firewall settings on both Mac and Ubuntu (that’s, incoming and outgoing ports), the running services such as AFP and Avahi-Daemon, and the mistyping errors that you might have entered into the configuration files that I mentioned above.