Restic for backups


maxse

Recommended Posts

I’ve been exploring different options to back up my main box. Tried VMs with Arq, and It just doesn’t cut it. I decided on running a minio S3 docker on the remote unraid box. 
 

It seems like restic, although no GUI would be the best option. 
But I can’t seem to find any info on how to install it and have it working with unraid. It seems like a popular backup tool just not much on unraid. 
 

can you guys help me out on how I can use this thing? I really don’t want to have to create a VM again just to use a command line type of backup. 
 

Would appreciate some help 

Link to comment
  • 3 weeks later...

Borg is in the NerdPack, it's comparable to Restic, but adds compression. I've just spent weeks developing my own scripts to use Borg from my Linux Desktop to unRAID, and for unRAID to perform server-side checks on the repository on a scheduled basis. It took weeks because it's my first go at bash scripts, and i'm also quite anal :)

 

It's really interesting that Restic is available as a Docker. It just seems odd to me! I'd be interested to hear how you go with it.

Link to comment

@mlapaglia I've seen some efforts on the client side, but nothing comprehensive to manage a range of backup operations performed on a server.

 

Borg has Vorta, and this project seems very similar for Restic:

https://github.com/Mebus/restatic

 

Now for Borg, i've seen this astonishing server-side effort: "Borg Backup Server". It looks quite amazing, but it's been in development for i think about 1.5 years and as far as i know it's not yet considered ready for the big time. I presume it also needs a bunch of effort getting it running - some webserver or something. Looks amazing though and maybe one day we'll see it available as a plugin.

 

 

Edited by Derek_
Link to comment
On 1/13/2020 at 11:26 PM, mlapaglia said:

@Derek_ that is SLICK! Is it only for synology? https://roll.urown.net/NAS/borg-backup-server.html# , maybe not their website is vague http://www.borgbackupserver.com/

I don't think it's for Synology at all. My guess is you'd have to install nginx or something to use it. It's really aimed at enterprise i think. The guy who is making it runs a webserver business i think, and he wanted to ditch whatever expensive backup software he uses and switch to Borg, but it wasn't easy to manage across dozens (hundreds?) of hosts, so he's developing his own management console.

From what i've gathered it's a solo effort.

If you don't have many devices to backup, then it's really overkill. Borg is pretty robust from what i've seen, and you can configure desktop notifications or emails. It's not all there for you, so it can require some work to set it up if you're anal about it (like i am), but it's pretty much set and forget once you're done (i'm not yet done, i'm about half-way there).

 

It'd made a pretty sweet Docker in unRAID, eh? ;)

Edited by Derek_
Link to comment
On 12/23/2019 at 12:32 AM, maxse said:

I can’t seem to find any info on how to install it

@maxse, FYI, I'm just getting started with restic, and to install it I downloaded the 'linux_amd64' build from the restic releases page on Github, and have a script called from /boot/config/go that (along with plenty of other boot-time tweaks) handles copying it to /usr/local/bin.

 

I'll also mention that my startup scripts set the XDG_CACHE_HOME environment variable to point to a dir I made on a nice, speedy Unassigned Device (though you could also use /mnt/cache/.cache or wherever you like) so that restic makes all its cache files somewhere persistent, instead of in the RAM disk, where they'd be lost on a reboot, which almost certainly isn't what you want!

 

The restic Docker container may be great, but it sounded like an un-necessary layer of complication to me, so I approached it this way.

Edited by bland328
Link to comment
  • 1 year later...
On 1/21/2020 at 2:44 PM, bland328 said:

@maxse, FYI, I'm just getting started with restic, and to install it I downloaded the 'linux_amd64' build from the restic releases page on Github, and have a script called from /boot/config/go that (along with plenty of other boot-time tweaks) handles copying it to /usr/local/bin.

 

I'll also mention that my startup scripts set the XDG_CACHE_HOME environment variable to point to a dir I made on a nice, speedy Unassigned Device (though you could also use /mnt/cache/.cache or wherever you like) so that restic makes all its cache files somewhere persistent, instead of in the RAM disk, where they'd be lost on a reboot, which almost certainly isn't what you want!

 

The restic Docker container may be great, but it sounded like an un-necessary layer of complication to me, so I approached it this way.

Can you share with us steps of how to directly install restic on unraid?
Also the script that you made to use restic?

I want to use restic with rclone, I installed the rclone plugin and it is working with my remotes, but now I want restic to use those remotes..

 

Hopefully someone smart will create a plugin for restic too!!

Link to comment
  • 5 months later...

You can use a docker container for running restic.
All you need is:
-Docker Container with restic (own one or from dockerhub)
-User Scripts to run backups cyclic
-Unassigned devices (if you want to copy to ext drive)

Here is my actual progress. At the moment iam wondering why the backup is so slow... And copying isn´t working as expected.. 

Backup script:

pw="/mnt/disks/Samsung_Flash_Drive_FIT/10_Scripte/11_ResticBackup/.resticpwd"
src="/mnt/disk2/HDD2_4TB/99_ResticRepo/ backup /mnt/disk1/HDD1_3TB/10_Homes"
dest="/mnt/disk2/HDD2_4TB/99_ResticRepo"
tag="HomesFolder"

#Backup and clean repo
docker exec debian restic -r $dest backup  $src --tag $tag --password-file $pw
docker exec debian restic -r $dest forget --keep-within 2m --prune --password-file $pw


Copy script --> Internal Backup to USB drive if connected

#
srcPath="/mnt/disk2/HDD2_4TB/99_ResticRepo"
dstPath="/mnt/disks/JMicron_Generic"

#Waiting time to secure mount accomplished
sleep 10
beep -f 587.3 -l 122 -d 0 -n -f 370 -l 122 -d 0 -n
rsync -av --stats "${srcPath}" "${dstPath}" &
pid=$!

# If this script is killed, kill the `rsync'.
trap "kill $pid 2> /dev/null" EXIT

# While copy is running...
while kill -0 $pid 2> /dev/null; do
    # Do stuff
    #echo "Rsync is running"
    sleep 1
done
beep -f 587.3 -l 122 -d 0 -n -f 370 -l 122 -d 0 -n

# Autounmount, wenn nicht gewuenscht, einfach ein # davor setzen.
sleep 120
umount -f -l "${backup_root_path}"
# Notification
/usr/local/emhttp/webGui/scripts/notify -i normal -s "Disk ausgehangen." -d "Backup abgeschlossen, Medium kann entfernt werden."

# Disable the trap on a normal exit.
trap - EXIT






 

Link to comment
  • 1 year later...

Hi guys, I am a very new unRaid user and would like to use restic for my backups. Unfortunately, I am not getting anywhere here on my own.

 

About my setup:

- Unraid in version 6.11.5
- Array with 2 HDD in xfs forma
- Cash with one SSD in brfs
- Another SSD with unassigned devices in btrfs format on which the repository of restic is.
- I installed restic 0.15.1 via NerdTools. 

 

Creating the backups by adding snapshots works as desired, at least manually. Automating the backups is a job for another day.

What doesn't work is mounting my repository. I use the command: "restic -r /mnt/user/repository mount /mnt/disks/backup/rmount". 

 

As a result, I get the following error:

image.png.010d4c637fc253eedd9b49146fba2461.png

 

Various research in forums, also on the subject of rclone with similar errors on mounting, have brought me to the point that I now suspect that the restic does not get along with the fusermount3 version of unraid. If someone could help me to get restic to mount, I would be very grateful.

  • Confused 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.