Help! - Restore from Rsnapshot

  • Welp I really did it this time...and could use some major help.


    Can anyone share the best practice on restoring a sharedfolder from an Rsnapshot backup?


    For some background:

    I was messing around with my perfectly working server and messed with ACLs, bad idea. Ugh.


    I have a sharedfolder called /Docker on my primary drive that contains all of my compose files, docker volumes, configs, etc. I messed with ACLs and accidentally overwrote all the permissions for the entire sharedfolder & sub-directories, which completely borked my containers. I tried to reset the ACLs but to no-avail, as some of the sub-directories (very many) had unique owners/permissions.


    Luckily, I keep a second drive that I use the Rsnapshot plugin to backup to daily. I am hoping to be able to use that to restore the /Docker sharedfolder back to the primary drive. Is there a preferred method to doing so? Any help is appreciated...I really messed up this time.


    Thank you in advance! All help is appreciated!

  • either using rsync from CLI

    rsync -a source destination


    or by pointing shared folders to source and destination and setting up a rsync job in the GUI of OMV.


    However, I do not know, how ACL play into this. Hope you did not use ACL before creating the mess ;-)

  • Luckily I did not mess with ACLs prior to this and I checked the snapshots on the backup drive and permissions look correct (phew).


    I did some of my own reading too and looks like rsync -a should be the way to go, I will report back later today when I return home from work. Thank you macom


    As a side note I learned a valuable lesson once again in computing: permissions are powerful & don’t click/command stuff (especially not recursive) that you don’t understand!! =O

  • Good advice, I am indeed a novice. Do you recommend trying to recreate the same problem with a dummy sharedfolder?


    Ex: make a dummy sharedfolder with some random dummy files with different ownerships/permissions on them, back that up with Rsnapshot, change the ACLs on the dummy sharedfolder (like I did in reality, d’oh!) then try to restore with —rsync -a “/dummysnap/daily/“ “/dummysharedfolder/“


    Thinking something like that? Or do you have another suggestions? Thank you.

  • Solved!


    Thank you for all the help macom I truly appreciate it.


    For those that stumble upon this thread - I keep a parity drive on my small home NAS server that I run RSNAPSHOT via the OMV plugin to backup the main DATA drive to a local BACKUP drive, I chose this over RAID for this exact reason as I didn't want live mirroring but instead truly a backup drive. Thankfully this saved my a** (apparently) this time around as I was able to rsync the snapshot from the day prior to my ACL incident (see above) back to my DATA drive for the sharedfolder that houses all my Docker containers, files, volumes, etc.


    Here is what I did:

    1. identified the snapshot to restore from on the BACKUP drive, for me it was the day before /.../BACKUP/sharedfolder/daily.0/


    2. made a backup of the DATA drive with rsync (precaution) to a separate external hdd I had lying around


    3. stopped docker that runs in the sharedfolder and uninstalled using OMV gui (not sure if this was entirely necessary but felt it might be cleanest)


    4. restored the affected DATA drive sharedfolder from the snapshot on the BACKUP drive using rsync, command in bold below, obviosuly replacing the /source/ and /destination/ directories with the ones on my machine

    rsync -avP /.../BACKUP/daily.0/ /.../DATA/sharedfolder/ (rsync -arguments /source/ /destination/)

    paying special attention to the trailing slashes per macom's advice, here is a good overview from digitalocean on restoring using rsync


    5. for whatever reason I did need to change permissions on the sharedfolder top level directory as that did not get changed, easy enough using chmod and ensuring this is not recursive into the subdirectories. My assumption is because of the use of trailing slashes on rsync it dumps the contents of the backup directory files, permissions, symlinks, etc but not for the top level


    6. reinstalled docker to the same sharedfolder using OMV webgui, then after waiting a few restarted it


    7. had to ssh in and run docker-compose up again as user with permissions for containers to restart them


    So far - everything seems to be back in working order, I have kept my extra backups prior to restoring on external HDDs for now and have bumped the rsnapshot for that sharedfolder to hold snapshots for a year, just in case. Although everything seems to be working right now my fear was that rsnapshot takes backups per scheduled job and I don't shut the docker containers down for that, so a file could have been corrupted during a backup and I wouldn't know. It appears to not be the case but I will monitor for now to be sure.


    EDIT: one more thing - DO NOT MESS WITH ACLs UNLESS YOU KNOW WHAT YOU ARE DOING!!!

  • keeks12

    Added the Label OMV 5.x
  • keeks12

    Added the Label resolved

Participate now!

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