If anyone knows, Time Machine is such a great backup service out of the box for Apple OS X,
here and
here you can read more. If you have a poppy, and you do not use the "time machine", then it is absolutely in vain. Time Machine makes permanent differential backups, so it is convenient even in the case of the wonderful life of your HDD / SSD. You can unscrew the history at any time and restore the accidentally deleted file, or, more importantly, the previous version of the modified file.
It is assumed that users will use either a regular hard drive or a special network device
Time Capsule . A traditional external hard drive is a solution for very organized people who will regularly (at least daily) connect it to an automatic backup, otherwise the benefits of the time machine will be very limited (although last year’s backup is still better than nothing at all). With a time capsule will be much more convenient and reliable. In addition to the backup function, it can also perform the function of network balls, Wi-Fi distributions (in fact, Time Capsule is a Wi-Fi router with HDD). But the device costs money, and it is not so universal. I wanted to fasten the ability to make backups of the time-machine working on Ubuntu to my server. And it's not so difficult, and this note will be about.
')
So we have Ubuntu 12.04 LTS. The functionality we need is in the netatalk package, this is an open source implementation of the AppleTalk protocol, we also need to install an avahi-daemon package to implement the zeroconf infrastructure in our network, in this case, an imitation of the favorite Apple technology Bonjour.
avahi-daemon can be delivered immediately:
sudo aptitude install avahi-daemon
C netatalk is a bit more complicated, at the time of this writing, release version 2.2.2 was already released with a bunch of new fixes (see
http://netatalk.sourceforge.net ), and there was still a version of half a year ago 2.2.1 in the ubunt reps. I wanted to put a newer version. This can be done by building from source, but at that moment it could have been done differently. A ready-made package
2.2.2 has already appeared on the
launchpad , so download it and install it.
wget http://launchpadlibrarian.net/103717335/netatalk_2.2.2-1_amd64.deb sudo dpkg -i netatalk_2.2.2-1_amd64.deb
Next, you need to configure the services.
Create an afpd.service file that describes specific services distributed by AppleTalk Filing Protocol by the afpd daemon:
sudo nano /etc/avahi/services/afpd.service
with the following content:
<?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_afpovertcp._tcp</type> <port>548</port> </service> <service> <type>_device-info._tcp</type> <port>0</port> <txt-record>model=Xserve</txt-record> </service> </service-group>
Here you can change the name of the service and the icon of the remote computer that are displayed in the Finder on the poppy, they are responsible for the lines
<name replace-wildcards = "yes">% h </ name>
where% h is the computer name (host);
<txt-record> model = Xserve </ txt-record>
where instead of Xserve you can put: Macmini, iMac, MacPro, Xserve, MacBook, MacBookPro, MacBookAir.
Next, configure netatalk. The config in / etc / default / netatalk can not be changed, everything should work and so. But /etc/netatalk/AppleVolumes.default needs to be changed.
sudo nano /etc/netatalk/AppleVolumes.default
Go to the end of the file
(Ctrl + V run through the pages faster) .
Add a line:
/data/backups/TimeMachine "TimeMachine" cnidscheme:dbd options:tm,upriv,usedots allow:alex
where / data / backups / TimeMachine is the path to the directory where backups will be stored;
TimeMachine is the name of the shared resource.
In options should be tm - resource for the time machine.
allow: alex - user with access to the directory. He (in this case, alex) should be on your server (for convenience, I also made the user on ubunt and on the poppy have one name), you can create a user using the useradd command.
You can add another shared ball, for example:
/data/common "Common" cnidscheme:dbd options:usedots,upriv dperm:0776 fperm:0666 allow:@shares
Here in the options no longer need to specify tm.
Here dperm: 0777 fperm: 0666 - rights to the created directories and files,
allow: @shares - access only to users belonging to the shares group (you can create a group using groupadd and add a user to an existing group usermod -a -G groupname username)
Rights and group - so that this ball can be conveniently used by several people. To do this, people create accounts, and they add a group of shares. Unfortunately, I did not find the opportunity to do it like in a samba, so that new files were created on behalf of the group, so I had to give full rights to others, otherwise the files created by one person could not be edited by others.
Restart the service:
sudo service netatalk restart
Restart avahi
sudo service avahi-daemon restart
That's all.
PS
Although no, it was not without a file. Those. Immediately nifiga did not work, the symptom is this: in the finder, we try to connect to the ball, and he says that there is nothing there, where to connect? It turned out that afpd did not really start.
cat /var/log/syslog
gave the following:
May 12 03:13:26 mini-server afpd [13367]: =================================== ============================
May 12 03:13:26 mini-server afpd [13367]: INTERNAL ERROR: Signal 11 in pid 13367 (2.2.2)
May 12 03:13:26 mini-server afpd [13367]: =================================== ============================
May 12 03:13:26 mini-server afpd [13367]: BACKTRACE: 3 stack frames:
May 12 03:13:26 mini-server afpd [13367]: # 0 / usr / sbin / afpd (netatalk_panic + 0x1c) [0x7fd5ac5e6b0c]
May 12 03:13:26 mini-server afpd [13367]: # 1 / usr / sbin / afpd (+ 0x53c0c) [0x7fd5ac5e6c0c]
May 12 03:13:26 mini-server afpd [13367]: # 2 /lib/x86_64-linux-gnu/libc.so.6(+0x364c0) [0x7fd5aaf444c0]
Googling problems gave a solution. Open /etc/netatalk/afpd.conf:
sudo nano /etc/netatalk/afpd.conf
and change the most recent line to
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
The problem was in the library uams_dhx2.so, which is not friendly with Lion, helped replace the uams_dhx2_passwd.so.