(c) Brian Reay
25/7/13
For Kent Linux User Group
Introduction
Timecapsule
First the some network protocols (includes avahi, also
required for the Airprint Server)
Install netatalk
Install avahi
Both are available in the Ubuntu Software Centre but you can use:
sudo apt-get install netatalk
sudo apt-get install avahi-daemon
You need to edit some of the configuration files:
Firstly, with your preferred text editor and root priviliges (eg sudo
gedit):
To the end of: /etc/netatalk/afpd.conf
Add:
- -tcp -noddp -uamlist uam_guest.so,uams_dhx2_passwd.so -nosavepassword
Save and exit.
Next we need to set up the locations for saving the backups.
The file to edit is: /etc/netatalk/AppleVolumes.default
Using your preferred text editor:
1. Comment out the line: ~/
"Home Directory"
2. Add lines to describe the backups you wish to provide.
Some examples:
/home/brian/TimeMachine "TM on Ubuntu" cnidscheme:dbd
options:usedots,upriv,tm allow:brian
/home/john/MacBook "John's MB_TM" cnidscheme:dbd
options:usedots,upriv,tm allow:john
/home/john/Mini "John's Mini_TM" cnidscheme:dbd
options:usedots,upriv,tm allow:john
/home/lizzie/MacBook "Liz's MB_TM" cnidscheme:dbd
options:usedots,upriv,tm allow:lizzie
These provide backups for three machines across two users. Each
machine's backup has its own directory.
The services will be "seen" in the Time Machine window by labels shown.
In each case, the Linux user name and password will be required when
selecting the "disk" from Timemachine.
If you run a fire wall on your machine, then you will need to allow the
traffic through. For "Shorewall" you need to add:
ACCEPT net fw tcp 548 to the rules file and restart
Shorewall.
For other firewalls, you will need to do the equivalent.
Next, either reboot or restart netatalk with: sudo service netatalk
restart
That should be the Linux side complete.
Next, you need a Mac.
Select Timemachine (in
Settings) and add back up disk. You should see a list of the
available disks (in the example above John's MB_TM, John's Mini_TM,
Liz's MB_TM . Select the one appropriate to your machine and
enter the Linux user name and password. All being well, the disk should
connect and the first back up initiate. Be warned, the first backup
takes sometime (a couple of hours typically on the three Macs here).
Don't worry, subsequent backups happen without you noticing.
Note: If you get
an OSStatus Error 2, suspect a path error in your AppleVolume.default
file, a missing directory, a 'permissions' problem etc. Fix these and
try again. Don't forget to restart services (or reboot) after changing
config files.
Airprint Server
You need a PC with Linux,
I've assumed Ubuntu, and avahi installed (see above). Also your
printers should be installed and verified as working and I've assumed
you have CUPS installed. I don't recall seeing a Linux machine without
CUPS, other than a R Pi, for some time. You need not get involved
with CUPS, I can let you have a working cupsd.conf file if you prefer.
If you want to edit the cupsd.conf file, the essential changes to the
/etc/cups/cupsd.conf file are:
(keep a copy of the old file just in case, cups config files can be a pain.)
Listen 631
Browsing on
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
BrowseAddress @LOCAL
ServerAlias *
I'm happy to let you have a copy of my working file, just copy it to
the right place.
Restart cups or reboot after all the changes.
https://github.com/tjfontaine/airprint-generate
The tool generates a script for each printer. Place the script(s)
in /etc/avahi/services .
Either restart avahi with:
/etc/init.d/avahi-daemon restart
or reboot
(I tend to make all the changes and do a reboot- some people don't like
this but each to there own...)