[GUIDE] Rsnapshot From One OMV Host to Another OMV Host Using Command Line

    • OMV 2.x
    • [GUIDE] Rsnapshot From One OMV Host to Another OMV Host Using Command Line

      Rsnapshot From One OMV Host to Another OMV Host Using Command Line


      Description
      This little tutorial describes how to use rsnapshot on an OMV host (hereby referred to as "Backup Host") to directly do snapshot backups of data residing on another OMV host (hereby referred to as "Main Host").
      In other words, you will not need to rsnapshot onto "Main Host" first and then transfer the snapshots to "Backup Host" via rsync (or any other method).
      This can be useful for those who prefer to keep snapshots and the data on separate hosts due to various reasons (mine was the lack of HDD space and SATA ports in any of the hosts) and if the remoteshare plugin does not work (which is fixed in OMV 3).

      Requirements
      - Two OMV Hosts (preferably fully updated, same OMV versions)
      - Both connected in a LAN
      - Being willing and able to work with command line (e.g. PUTTY)

      Procedure
      • Keep in mind that rsnapshot is a pull-based design; the "Backup Host" running it will pull the data from the "Main Host" (see links 1 and 2). You can't push data from the "Main Host" in other words.
      • In "Main Host", use OMV GUI to create SMB share of the data you want snapshots of (You may also use other network sharing protocols like NFS but I have yet to try this)
      • (Optional) In "Backup Host", use OMV GUI to create SMB share to contain the snapshots (You may also use other network sharing protocols like NFS but I have yet to try this)
      • In both hosts, install the Rsnapshot plugin using the OMV GUI
      • In both hosts, enable SSH using the SSH plugin in the OMV GUI
      • Open two command line windows, one for the "Backup Host" and another for the "Main Host"
      • In both hosts, execute "sudo apt-get install cifs-utils" or equivalent for the network protocol used (see link 3)
      • In "Backup Host", make a mount point (e.g. sudo mkdir /media/samba) (see link 4)
      • In "Backup Host", open /etc/fstab with your text editor (e.g. sudo nano /etc/fstab/)
      • Add the share of the "Main Host" in the last line of fstab (e.g. //192.168.1.21/test /media/samba cifs defaults,credentials=/etc/samba/credentials 0 0) (see link 4)
      • In "Backup Host", create /etc/samba/credentials with your text editor (e.g. sudo nano /etc/samba/credentials)
      • Add the credentials of the share like this into /etc/samba/credentials and save: username=[your username]password=[your password]
      • In "Backup Host", make the file owned by root and ro by root (e.g. sudo chown root.root /etc/samba/credentials && sudo chmod 400 /etc/samba/credentials) (see link 4)
      • In "Backup Host", execute "mount -a" to mount the share of "Main Host" (or you may restart "Backup Host")
      • In "Backup Host", open /etc/rsnapshot.conf with your text editor (e.g. sudo nano /etc/rsnapshot.conf)
      • Edit snapshot_root to where in "Backup Host" you want to save the snapshots to
      • Edit the backup points to point to the share of "Main Host" (e.g. /media/samba/ test/)
      • Edit any other parts as you see fit
      • Save rsnapshot.conf
      • In "Backup Host", execute "rsnapshot configtest" and "rsnapshot -t hourly" to test
      • Finally, execute "rsnapshot hourly" to perform the actual snapshot! (Or you may even cron this as you see fit)


      References
      1. askubuntu.com/questions/35180/…he-server-from-the-client
      2. digitalocean.com/community/tut…rsnapshot-on-ubuntu-12-04
      3. askubuntu.com/questions/525243…d-superblock-error/525246
      4. help.ubuntu.com/community/Fstab

      The post was edited 1 time, last by darkarn ().

    • If you used the remoteshare plugin on OMV 2.x or the remotemount plugin on OMV 3.x, you could do a push or pull rsnapshot all from the web interface.
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • That only affects the remoteshare plugin on OMV 2.x and that is only when using a shared folder with data in it or using / as the shared folder path. The remotemount plugin has neither issue. You could also just edit the mntent entry in config.xml and then omv-mkconf fstab with the remoteshare plugin. Just trying to give tips that reduce the amount of command line.
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Ah I see, is that remoteshare issue resolved in OMV 3.x?

      Also, I am unable to find the remotemount plugin at all (even with OMV extras installed)...

      Hmm, did the remoteshare plugin in OMV 2.x get renamed to remotemount plugin in OMV 3.x (and thus the issue is more or less resolved in OMV 3.x)?
    • darkarn wrote:

      did the remoteshare plugin in OMV 2.x get renamed to remotemount plugin in OMV 3.x (and thus the issue is more or less resolved in OMV 3.x)?
      No. It was completely rewritten and given its own name. There is no upgrade path. It doesn't have the issue because it creates it own mountpoint just like other filesystems. There would be no files in it. You can also easily edit the options that go into fstab.
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      darkarn wrote:

      did the remoteshare plugin in OMV 2.x get renamed to remotemount plugin in OMV 3.x (and thus the issue is more or less resolved in OMV 3.x)?
      No. It was completely rewritten and given its own name. There is no upgrade path. It doesn't have the issue because it creates it own mountpoint just like other filesystems. There would be no files in it. You can also easily edit the options that go into fstab.

      Thanks! Let me upgrade to OMV 3 and see how this goes
    • darkarn wrote:

      The remotemount plugin solved all of these issues.
      Good to hear :)
      omv 4.1.22 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!