Backing up database on Linux

Support instructions tell how to back up your Roon database on Windows and OS X, but not on Linux. Is there a recommended way to do this, or do I just dig through the install script to figure out what’s where and how to stop Roon Core (just kill -1 won’t do it, it pops back up soon, but I worry kill -9 might be too extreme).

Roon Server runs as a service: you can safely stop and start it by issuing

sudo systemctl stop roonserver

and

sudo systemctl start roonserver

I’m running a nightly cron job that stops roonserver, backups the database via rsync and restarts roonserver.

@RBM, could you share it to save me reinventing wheel?

I like it simple - in root’s crontab:

55 2    * * *   systemctl stop roonserver.service
00 3    * * *   rsync -av --delete /var/roon/RoonServer/ /media/data/backup/RoonServer/
25 3    * * *   systemctl start roonserver.service

At 4 o’clock, the entire /media/data disk (including the music files) is backed up to a different disk (/media/backup) via the user’s crontab.

5 Likes

Thanks, it worked!

This script is only a one day backup right? Won’t help if an error is made earlier then.

That’s right – this is a plain sync offering some protection against hardware failure. I do not want to keep files I have deleted for a reason to keep on piling up, but rsync offers many options allowing you to choose your own comfort level.

I also run a weekly sync to a remote location, offering protection against fire and theft (as well as acts of God, my insurance company would add), offering a few days leniency against my own dumbassery.

I’ll probably replacing this with Backblaze B2, which is cheap and offers a command line for operations. B2 sync has a nice option set as well, including specifying the number of days to keep deleted files.

In case of total failure, they can ship a drive with a snapshot of up to 3,5TB for $189,00. I guess I’ll be safe. :slight_smile:

And in case anyone is interested: I just set up Backblaze B2 syncing, using rclone in a cron job:

00 7 1,15 * * /usr/sbin/rclone sync /media/backup remote:nucbackup --config=/home/rene/.rclone.conf --transfers 10 --quiet > /home/rene/rclone.log 2>&1

Creating a bi-weekly sync of my entire backup disk to Backblaze’s B2 environment. Not a bad deal at $0,005/GB/month.

1 Like

Trying to set up an rsync to my QNAP NAS to back up my Roon database. I get the error message: “rsync: link_stat “/home/dpsp/ssh” failed: No such file or directory (2)” followed by:

“rsync: [sender] write error: Broken pipe (32)
rsync: write failed on “/RoonBackUp/Cache/httpcache_2.db/003068.log”: No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync error: error in rsync protocol data stream (code 12) at io.c(820) [sender=3.1.1]”

All help would be appreciated to set this up. Thank you.

Good job I searched before posting. I discovered rclone yesterday after a fairly long trial-and-error search for something I could use to backup my library to Amazon Cloud Drive.

I actually don’t like using command line stuff for my home backups, but for one reason or another each solution I tried didn’t work or do quite what I needed. Since my ISP has traffic management on uploads during evenings and weekends, I need control over upload bandwidth and this lookis like the only way I’ll be able to do it (with a bit of scripting that’s as yet incomplete). I’m familiar with rsync so that helps.

I did a few test runs before unleashing it on a partially complete backup, and it worked exactly as intended - so far I’m impressed.