The best backup strategy

  • Hello everyone!

    I'm using OMV since 2019 and I don't plan on changing it for the foreseeable future. My machine has an i3 8100, 24 GB RAM and 6 SATA HDDs.


    I'm using snapraid for redundancy but I struggle with an optimal backup solution.


    What I need:

    - a program/script that would start when I plug in an external HDD, does its thing (and maybe notify me when it's done, so I can unplug the drive). I don't want the drive connected at all times, since a ransomware would easily destroy the backup if the drive is connected.

    - incremental backups


    The USB backup plugin sounds good, but it doesn't do incremental backups.


    Borgbackup does incremental backups, but it works with existing omv shares, so I can't insert and remove the drive as I please. Since a share is "referenced" in omv, it can't be mounted before the backup runs and unmounted afterwards.

    How should I handle it?

    Is the viable solution a second device that would pull the backups in? I have a RaspberryPi 3B, but I've read that they are not reliable when it comes to USB storage (the external HDD has its own power).



    Thanks everyone and especially @votdev and @ryecoaaron for their amazing work :!:

    • Official Post

    You could write your own script and use a udev rule to start it once the USB drive is plugged in.


    Is the viable solution a second device that would pull the backups in? I have a RaspberryPi 3B, but I've read that they are not reliable when it comes to USB storage (the external HDD has its own power).

    Many here do it like this.

  • You could write your own script and use a udev rule to start it once the USB drive is plugged in.

    Sadly my scripting skills are very limited and I don't even know what udev is.


    I'll give the Pi a try using borgbackup, then.

    Thanks for your reply! :thumbup:

  • jorel69

    Added the Label resolved
  • jorel69

    Added the Label OMV 7.x
  • update:
    I went with the Pi route, got a Pi4 (since the3B only has USB2 so it would take a lifetime), installed borgbackup on it and it runs via a cronjob. I'm pleased with the result. Thanks again for the input!

  • i used duplicati. I like the features of deduplication, blocking and the nice frontend.

    But i had the same problem with the external usb drives. I now mount them manually.

    Asking chatgpt gives many solution to automount usb drives, also using `udev`. I dont test it right now.



    Quote

    Step-by-step Guide

    1. Create a mount point

    Code
    sudo mkdir -p /media/usb

    2. Write a mount script

    Code
    sudo nano /usr/local/bin/automount-usb.sh

    Paste this content (you can adjust mount options and device filter later):

    Make it executable:

    Code
    sudo chmod +x /usr/local/bin/automount-usb.sh

    3. Create a udev rule

    Code
    sudo nano /etc/udev/rules.d/99-local-usb-mount.rules

    Paste this line (replace sdc1 with your target device or use wildcards):

    Code
    ACTION=="add", KERNEL=="sd[b-z]1", RUN+="/usr/local/bin/automount-usb.sh /dev/%k"

    4. Reload udev rules

    Code
    sudo udevadm control --reload
    sudo udevadm trigger

    5. Test it

    • Plug in the USB stick.

    • Check if it auto-mounts to /media/usb:

      Code
      mount | grep usb

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!