BackupPC-users

[BackupPC-users] Success: OSX backup without "secrets" and notes:

2017-05-31 11:35:05
Subject: [BackupPC-users] Success: OSX backup without "secrets" and notes:
From: Bob Katz <bobkatz AT digido DOT com>
To: backuppc-users AT lists.sourceforge DOT net
Date: Wed, 31 May 2017 11:33:30 -0400

Jeffrey West gave a recipe for OSX backup but I wanted to try a less complicated procedure without secrets or keys. And I've conquered it, to the best of my knowledge. However, on the OSX machine, I am concerned that this command seems to show four instances of the rsyncd daemon listening?  Or am I overconcerned?

Bobs-MacBook-Pro:bin bobkatz$ sudo lsof -i :873
Password:
COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
launchd   1 root   50u  IPv6 0xe8a85cb65c823a15      0t0  TCP *:rsync (LISTEN)
launchd   1 root   54u  IPv6 0xe8a85cb65c823a15      0t0  TCP *:rsync (LISTEN)
launchd   1 root   55u  IPv4 0xe8a85cb65c828f65      0t0  TCP *:rsync (LISTEN)
launchd   1 root   60u  IPv4 0xe8a85cb65c828f65      0t0  TCP *:rsync (LISTEN)


sudo launchctl list on the OSX machine shows the daemon but without a PID. I don't know what a "status" of 0 means, either:

-    0    org.samba.rsync

So while I was puzzling this through, I thought that rsync had not instantiated the daemon because launchctl did not display a PID. And there is no rsyncd.pid file either!  but the daemon seems to be running under launchd with an apparent PID of 1. And backuppc is able to talk to the OSX machine and has made a successful full backup and an incremental! Puzzling. But we move on because this works.

-------------------------------------------------------------

Here is my install and setup procedure for rsyncd on OSX without secrets or keys:

1) On the OSX machine you need to:

rsync --version    

before running the daemon

My previous backuppc failure was due to an outdated version of rsync on the OSX machine. If it's older than version 3 you need to install a new rsync on OSX (see below). If you accidentily ran the daemon with the old rsync, Kill the process. I also deleted the old rsync binary, but there's no guarantee Apple won't re-create it with a revision to OSX.

2) Create a new rsyncd.conf file. I put it into /usr/local/etc/rsyncd.conf     because that's where the new rsync install seemed to want to put it.

My rsyncd.conf file does NOT include a "secrets" line. Here it is with comments:


#######################################################################
##
##  RSYNCD config file for OSX
##
#######################################################################

gid = users

read _only_ = false
# false will allow backuppc to restore files to the Mac
transfer logging = false
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
## host allow: this is important.
## In my case leaving the subnet-mask leads to a failure,
## so I only provide the IP.
hosts allow = 192.168.0.217
 
## Now you have to declare, in brackets, the RSYNC 'module', or "share name" as it is called within backuppc
   [Backup-Data-Folder]
   ## Next, set the path you want backed up. Be sure to use a trailing slash
   path            = /Users/bobkatz/
   read only       = no
   list            = yes
   ## the easiest way is to use the root user
   ## This user has "ROOT"-privileges, so he can save files.
   uid             = root
   gid             = nogroup


# if you need to back up a different path, make an additional module like the above and call an additional share name within backuppc. One share name is required per each declared path!!!!


3) On the OSX machine in terminal type:

rsync --version

If it's before version 3, do:

which rsync

I deleted the old rsync. No guarantee OSX won't recreate the outdated rsync with an OS update, however.

4) Install a new rsync. You will need an OSX-compatible package installer. That will be 'homebrew'.  If the

brew

command does not work, then install homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then, install rsync with homebrew:

brew install rsync

Where is this new rsync installed? In terminal:

which rsync

If it finds it, then type:

rsync --version

to confirm you have the right one, which should be version 3+. However, OSX may take time to find the new one. I believe I kept on hammering 'which rsync' in terminal until it found it.


6) But in case it doesn't find the new rsync, find out the paths:

echo $PATH

If the new rsync installer put it into one of these paths it should run, but it took a few tries of my running
rsync --version for the system to find the newly-installed rsync. The top path was actually the one where the new rsync was installed so it makes little sense why the system didn't find it at first, but eventually it did.

Then, finally, run:
sudo rsync --daemon


7) Now you can go to backuppc, configure the new client and start a backup.

8) Once you are happy, you need to configure the daemon to run each time at startup. OSX does NOT use cron or inet.d so you have to make a plist file. You can try changing the locations in the following plist to the standard locations for rsync, but I followed the lead of this new rsync install and where it wanted to put things. The new rsync install used some symlinks so I advise checking that each of your elements corresponds with or links to the locations in the plist. This did work for me:

To launch rsyncd, The following plist (property list) file is installed as owner root into /Library/LaunchDaemons/org.samba.rsync.plist. 

sudo touch org.samba.rsync.plist

-rw-r--r--   1 root  wheel     0 May 30 20:50 org.samba.rsync.plist

I gave it 644 permissions. On OSX it's easiest to edit with the free 'textwrangler'.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Disabled</key>
        <false/>
        <key>Label</key>
        <string>org.samba.rsync</string>
        <key>Program</key>
        <string>/usr/bin/rsync</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/local/bin/rsync</string>
                <string>--daemon</string>
                <string>--config=/usr/local/etc/rsyncd.conf</string>
        </array>
        <key>inetdCompatibility</key>
        <dict>
                <key>Wait</key>
                <false/>
        </dict>
                <key>Sockets</key>
                <dict>
                        <key>Listeners</key>
                        <dict>
                                <key>SockServiceName</key>
                                <string>rsync</string>
                                <key>SockType</key>
                                <string>stream</string>
                        </dict>
                </dict>
</dict>
</plist>



Then restart the Mac and ensure you can back it up.



Regards,


Bob


--

If you want good sound on your album, come to
Bob Katz 407-831-0233 DIGITAL DOMAIN MASTERING STUDIO
Author: Mastering Audio              
Digital Domain Website

No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced.

--

If you want good sound on your album, come to
Bob Katz 407-831-0233 DIGITAL DOMAIN MASTERING STUDIO
Author: Mastering Audio              
Digital Domain Website

No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
<Prev in Thread] Current Thread [Next in Thread>

ADSM.ORG Privacy and Data Security by KimLaw, PLLC