Changes in rsnapshot behavior

  • Hello,



    I started using the rsnapshot plugin some weeks ago. Everything was fine.


    The backup files were stored under the label-ID of the source HDD on my backup HDD ([BACKUP-HDD]/[LABEL]/weekly.0/[folder]).


    Today I added a new backup job. I saw, also the old job were rewritten in /var/lib/openmediavault/rsnapshot.d/rsnapshot-*.conf.


    Now all the backups are using the UUID of the source HDD. They want to be stored in [BACKUP-HDD]/media/[UUID]/weekly.0/[folder].


    This breaks with the previous backups. The monthly can't be done, because it didn't find the weekly.3 and the weekly starts from source with copying the real files instead of hardlinking them.


    Is this a bug or was the behavior changed with an update? Is it from the plugin or form the way OMV submit the paths to the plugin? Will it changed back or will it stay like this?


    I don't want to reorder the structure of the backups now, for rolling it back in a couple of days/weeks...



    thanks,


    will;

    • Offizieller Beitrag

    None of the core functionality has been changed since the plugin was released. I use the plugin myself and it isn't having any issues??

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Okay. How are the backups stored on your mashine? The way with the label or with /media/UUID ??


    What is the planned behavior of the plugin?


    Did you add, remove or change one of your rsnapshot job in between the last two or four weeks?


    Because, everything was fine for me too. I played around a little bit with anacron this morning and did a weekly snapshot to the old supposed directory (LABEL). Then I add a new job and the storage target changed. I figured out, that also the old jobs were rewritten in /var/lib/openmediavault/rsnapshot.d/, by saving the new one. This was the point the target changed.


    will;

    • Offizieller Beitrag

    Mine are stored by label. I haven't changed anything in quite a while. Does your source drive have a label? What filesystem is the source drive?

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • The backup drive has a label too.


    I suspect you could reproduce the (miss)behavior, when you backup your confs form /var/lib/openmediavault/rsnapshot.d/ and add, remove or change a rsnapshot job in the webgui and then compare the *.conf files. would you be so kind to test this?


    will;

    • Offizieller Beitrag

    I already have reproduced it in a VM.


    It uses path instead of label if the source drive is xfs because the script uses e2label to get the drive label.


    For some reason, even if I use a labeled ext4 partition, it still uses the path. The test to determine if it uses label is the following:


    # if mountpoint exists, sourcedevice is block and filesystem has a label, use the label as backup subdir name


    My VM is failing the "sourcedevice is block" test which makes it uses the path instead of label. I'm not sure what changed but I am wondering why it checks if it is a block device. If I remove the block check, it works for ext4 partitions.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Okay, well... I'm using ext4 file system, of course. It has a label. Everything seems to be alright...


    What does it mean? Is it a bug, that will be fixed someday?


    Where can I remove this "sourcedevice is block"-check? Or should I wait for an update.


    At the moment I deactivated all my backup jobs... no good.


    will;

    • Offizieller Beitrag

    Fixed someday? I thought that's what we were discussing how to do and I am one that can change it :) I will remove the block check and we will see if any problems arise. Update should be there in a few minutes.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Did the update work?

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    I thought you were using OMV 0.6/1.0. The 1.0.2 version won't work with 0.5. If you want to make the change manually, do this:

    Code
    nano +86 /usr/share/openmediavault/mkconf/rsnapshot


    Change the line to this:

    Code
    if [ -e "${mountpoint}" ] && [ -n "$(e2label ${sourcedevice})" ]; then


    ctrl-o to save, ctrl-x to exit

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hello,


    Oh no, I'm very sorry. I forgot to mention, that I'm on stable. OMV is 0.5.53, OMV-Extras is 0.6.22.1 and openmediavault-rsnapshot is 0.5.6.2.


    Now I chagend the line like you described. But now something really scary happened! The source drive suddenly lost/changed its label! Now it uses the first part of the uuid with the prefix "/media/":


    Code
    /dev/sda1: LABEL="/media/9bc82394-" UUID="9bc82394-033a-4bd4-8c45-22b9daa785f5" TYPE="ext4"


    I'm very sure, that yesterday the label still was "Glotze4T"...


    I don't think this is related to rsnapshot or change in the conf file I did. But I've little anxiety, now...


    I'm going to check my log files.


    will;

    • Offizieller Beitrag

    All you did was remove an statement in the if statement. Not sure how that would change the drive label??

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hi ryecoaaron,


    at first I did a separate backup of my files, because this really strange behavior makes me fear. This took a while.


    This morning i figured out how to change back the label (I never needed to do this before) and now I understand what happened.


    Code
    e2label ${sourcedevice}


    changes the label!


    from "/usr/share/openmediavault/mkconf/rsnapshot"

    Code
    sourcedevice="$(cat /etc/mtab | grep ${mountpoint} | cut -d " " -f 1)"


    gives me

    Code
    root@rumpelkiste:~# cat /etc/mtab | grep /media/9bc82394-033a-4bd4-8c45-22b9daa785f5 | cut -d " " -f 1
    /dev/sda1
    /media/9bc82394-033a-4bd4-8c45-22b9daa785f5/Filme


    The second line (/media/9bc82394-033a-4bd4-8c45-22b9daa785f5/Filme) is from a shared folder for FTP. See my mtab below.


    by executing the script I have

    Code
    e2label /dev/sda1 /media/9bc82394-033a-4bd4-8c45-22b9daa785f5/Filme


    what says change the label...


    Here is my complete mtab. Where you caan see the two entries for the mount point.


    will;

  • Hi ryecoaaron,


    I tried a few things to handle multiple occurrence of UUIDs in the mtab.


    Code
    sourcedevice="$(cat /etc/mtab | grep ${mountpoint} -m 1 | cut -d " " -f 1)"


    This would use only the first line. But I don't know, if the FTP mounts will always appear at the end of mtab.
    If not you could use an additional grep pattern "/dev/"

    Code
    sourcedevice="$(cat /etc/mtab | grep ${mountpoint} | grep "/dev/" | cut -d " " -f 1)"


    I fiddle around a little bit to find a way, which is not possibly changing something.

    Code
    sourcedevice=$(ls -l /dev/disk/by-uuid | grep ${mountpoint#/media/} | cut  -d "/" -f 3);
        # Returns only the "sdxx". Needs a "/dev/" in front, if it is used somwhere else.;
    
    
    ls -l /dev/disk/by-label | grep $sourcedevice | cut  -d " " -f 10
        # Returns the label.


    But this will have some problems with special characters or spaces in the label. They are replaced with "\x**". I don't know what convention is.


    Maybe you could also include a check for spaces like

    Code
    if [[ " echo $sourcedevice" =~ " " ]]
    then
        # stop and warn
    else
        # proceed
    fi


    What do you think?


    will;

    • Offizieller Beitrag

    Spaces would be easy to change to underscores. I am fine with using the by-uuid and by-label method. I will check it out :)

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Okay, I just recognized, that the "cut -d " " -f 10" is not correct, because the number of spaces in "ls -l" is not constant. Sorry.


    edit:


    Code
    ls -l /dev/disk/by-label | grep $sourcedevice | cut  -d ":" -f 2 | cut -d " " -f 2


    should work!?


    edit2: No it doesn't. Because the time/date can differ too.

    Code
    ls -l /dev/disk/by-label --time-style=long-iso | grep $sourcedevice | cut  -d ":" -f 2 | cut  -d " " -f 2

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!