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

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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!

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

    • 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.
      OMV 4: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4
    • 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!
    • Adoby wrote:

      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.

      marcsgirall wrote:

      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 5.3.4 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.5
      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!
    • 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. github.com/OpenMediaVault-Plug…8475cf2328be31f5cd38540c7

      This is for OMV 5.x only though.
      omv 5.3.4 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.5
      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!
    • 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. :)