I've created a script that adds an rsync server to my Brennan B2. Thanks to Martin Brennan for allowing me access to the buildroot configuration used to create the Linux version used by the B2.
Why rsync?
Well, it's because I have rsync running on all the computers at my house to backup everything to a NAS file server (Synology DS201+). Except my B2.
rsync does a really nice job of creating incremental backups. Only files that have changed since my last backup are copied from my various computers to my NAS. And each backup looks like a complete separate snapshot even though underneath there is only one copy of each unique file.
So my backups are fast, complete, and yet disk space efficient. And I run then automatically daily or weekly with no intervention required on my part. I have terabytes of videos, pictures, documents, music, etc. backed up. And I can restore files going back years. Accidentally delete a photo and don't realize it for several weeks? No problem, just find the last snapshot that contained that picture and restore it.
All because of having rsync servers running on my various devices. And now on my B2 as well!
You can learn more about rsync via the links I've posted down below.
Warning :
Installing rsync using my script requires using the Linux command line on your B2 via ssh - at least until Martin makes it a standard part of the B2. The installation requires you to run as "root" on your Brennan B2 as "root" is the only configured user. When running as "root", you can easily delete critical files - or even all files- if you make a typing mistake. A full backup of your music directories is strongly recommended before proceeding. You should also be comfortable with downloading a new SD card image from the Brennan web site and installing it on the SD card in your B2 should things go completely wrong.
Files added to the Brennan B2 for rsync functionality
/usr/sbin/rsync - the actual executable rsync client & server code
/etc/rsyncd.conf - configuration for the rsync server
/etc/rsyncd.secrets - user names & password for remote rsync access
/etc/init.d/S51rsync - file that starts rsync in daemon (server) mode at boot
Notes : - The examples below use a example Brennan B2 IP address of 192.168.0.200. Use the actual IP address of your B2 when you install the script. It will be visible on the scrolling section of the B2's OLED display when no music is playing.
- The password for rsync access is brennan and the rync user is b2. You should change both in the /etc/rsyncd.conf and /etc/rsyncd.secrets files.
- There are two rsync shares available - one for music on the hard drive (if installed) and the other for music on the SD card (no hard disk installed).
- The examples below assume a hard drive equipped B2 - use shareSD in place of shareHD for SD card only B2 models.
- When using actual artist, album, or song names that include spaces, use a \ before each space. For example, Jethro\ Tull/Thick\ As\ A\ Brick (note the forward slash / between the artist and song name)
- If you've come this far, I'd also suggest that you change the root password of your B2. "Security through obscurity" is a proven flawed concept.
Obtaining the rsync installation script : (rsync_install.sh)
The
rsync installation script was created using a tool from
makeself.io Running the script causes it to unpack the necessary installation file buried at the tail end of the script itself and then executing a setup script.
The md5sum check for the script is : 44ba430943c7df3a1c4567cd47beeebe
Transferring the Installation Script to the Brennan B2
You can transfer the rsync installation script to your B2 several different ways.
- If you have NAS enabled in your B2, then simply copy the rsync_install.sh file across your LAN to the NAS share.
- If you want to use a USB stick, copy the rsync_install.sh file to the USB stick and plug that into USB port C on the B2
- Copy it across using this command from a Linux computer : sftp -p ro...@192.168.0.200:/root <<< $'put rsync_install.sh'
It does not matter what folder you use on your B2 as long you can find the script.
Running the Installation Script (rsync_install.sh)
Run the script by logging onto you B2 via ssh and changing into whatever directory holds the script.
There are several script parameters you might want to try out in the order listed below.
./rsync_install.sh --help -- gives all the script run choices
./rsync_install.sh --list -- shows all the files that the script will install
./rsync_install.sh --info -- shares information about the script build and contents
./rsync_install.sh --check -- checks the integrity of the various files that will be installed
./rsync_install.sh --noexec -- simulates the installation, but does not actually run the install script
Finally, use one of these two command lines to install the rsync server.
./rsync_install.sh -- installs the rsync server and support files, cleaning up afterwards
./rsync_install.sh --keep -- installs the rsync server and support files, leaving the installation files laying around
Using the rsync server.
Once you have run the script, you an activate your rsync server by either restaring your B2 or by typing rsync --daemon from the ssh command line.
Then from your remote backup computer, try these commands :
Note the period or dot at the end of some of the commands.
Note that the first time you backup all of your songs, it will take about 5 to 10 seconds per song (depending on the speed of your PC and your network).
After that, only new music (or changes to existing files) will actually be backed up - total time usually only the 5 - 10 seconds per new song.
Here are some handy links if you want to know more about using rsync :
Rsync GUI clients
and lastly, the server based backup software that I use
Finally, there is no way for me to edit this post so check below for any corrections or clarifications.
HTH