Does anyone know how to make RSnapshot's cron file stick

  • So we recently had a scare where my RAID5 superblock up & disappeared last weekend (thank you modprobe raid5 command for existing, you saved my life!). Now my wife is a graphic designer & had recently done tons of work that she needed access to. So I grabbed my external incremental backup drive, figuring it would have her latest work on it only to find it hadn't been updated since october.


    It turns out that whenever RSnapshot updates, it overwrites the cron file & removes my preferred backup times. Which was a problem because my NAS did a powerdown cycle every night for 6 hours.


    So as a workaround - because data integrity matters more than drive longevity - I've switched to a 2 hour standby command rather than a power down & the backups are happening normally. I also paid for backblaze & set up a duplicati job.


    I'd prefer to have my cake & eat it, too, though. Is there any way to lock down the RSnapshot cron file to save myself this headache?


    Thanks in advance!

    • Offizieller Beitrag

    Evil, evil backup software that deletes cronfiles used to run it. Are you sure you set it up right? That is a terrible, terrible flaw!


    You could save copies of the RSnapshot cronfiles and use a regular cron job to restore them. You edit /etc/crontab to add some script to run. There are many tutorials on how to edit crontab. Or you could use a scheduled job in OMV.


    If you simply write protect the files, upgrades might fail. But it might otherwise be the simplest.

  • Yeah, when I said "Oh, have you done anything important since November?" I was not the most popular person in the house. & it's just the two of us.


    I think I set it up properly. The setup is pretty straightforward. Nanoed into the cron file, edited the scheduling, saved it. RSnapshot would back everything up properly for months & then eventually I realized it's stopped the backups & when I check the cron file it's back to 3, 3:30 am.


    I guess write-protecting the cron file is the smartest way to do it. Off to the tutorials! Like you said, worst case the update fails - what is it gonna stop backing files up? Thanks!

  • Turns out changing a source folder will also revert the cron file - figures it out cuz I’d defined the wrong sources & I tried to change them after already having setup write protection. This solution actually works really well cuz it forces me to think of the cron file if I ever need to change anything

    • Offizieller Beitrag

    Evil, evil backup software that deletes cronfiles used to run it. Are you sure you set it up right? That is a terrible, terrible flaw!

    It isn't a flaw. It is how OMV is designed. The plugin creates the cron job and maintains it. Just like any other config file that OMV maintains, it will overwrite changes. I have told the 2 or 3 people that have asked for the plugin to have the ability to change the times that they can submit a pull request.


    Turns out changing a source folder will also revert the cron file - figures it out cuz I’d defined the wrong sources & I tried to change them after already having setup write protection

    If you change the /usr/share/openmediavault/mkconf/rsnapshot file, changes will keep using your setting. The only time that files will change is if there is a plugin update. Probably not going to happen on OMV 4.x.


    That said, I don't understand shutting it down for 6 hours. The startups/shutdowns are harder on a hard drive than running an extra 6 hours. And if the data is that important, 6 hours of energy is neglible.

    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

    Ok, so I thought of an easy to make the change for the cron job starting hour. Not super flexible but it will prevent people from doing dumb things. Just change the OMV_RSNAPSHOT_STARTING_HOUR in /etc/default/openmediavault. https://github.com/OpenMediaVa…8475cf2328be31f5cd38540c7


    This is for OMV 5.x only though.

    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!

  • Thanks for the clarification.


    I spin everything down because I want to avoid wear & tear on all the components. I’ve read different things about hard drive longevity & I decided it made sense to power down to give the whole server a break daily.


    I’m running OMV4 so the write-protect option on /etc/cron.d/openmediavault-rsnapshot makes the most sense.


    Thanks for contextualizing & for the info about OMV5 should I decide to upgrade. :)

Jetzt mitmachen!

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