cron ignores time from /etc/cron.d/openmediavault-rsnapshot

    • OMV 3.x
    • cron ignores time from /etc/cron.d/openmediavault-rsnapshot

      Hi everyone,

      I have problem with the rsnapshot backups:

      If the system is not (!) running at midnight anacron executes the rsnapshots scheduled daily, weekly, ... in the correct order - fine

      If the system is running at midnight cron executes the rsnapshops although the time is set differently (default OMV settings) in

      Source Code: /etc/cron.d/openmediavault-rsnapshot

      1. # Create cron file
      2. # This is the cron file for openmediavault-rsnapshot.
      3. # The file /var/lib/openmediavault/cron.d/rsnapshot will mirror
      4. # the jobs that are configured in the plugin.
      5. # m h dom mon dow user command
      6. 5 * * * * root /var/lib/openmediavault/cron.d/rsnapshot hourly
      7. 30 3 * * * root /var/lib/openmediavault/cron.d/rsnapshot daily
      8. 0 3 * * 1 root /var/lib/openmediavault/cron.d/rsnapshot weekly
      9. 30 2 1 * * root /var/lib/openmediavault/cron.d/rsnapshot monthly
      10. 00 2 1 1 * root /var/lib/openmediavault/cron.d/rsnapshot yearly

      The problem with this behavior is, that daily, weekly, .. are started at the same time, and therefore the weekly task is not executed and I get the following email----------------------------------------------------------------------------rsnapshot encountered an error! The program was invoked with these options:/usr/bin/rsnapshot -c \ /var/lib/openmediavault/rsnapshot.d/rsnapshot-703e01fb-31a4-431a-ada3-05a3be299f6c.conf \ weekly ----------------------------------------------------------------------------ERROR: Could not write lockfile /var/run/rsnapshot-703e01fb-31a4-431a-ada3-05a3be299f6c.pid: File exists----------------------------------------------------------------------------rsnapshot encountered an error! The program was invoked with these options:/usr/bin/rsnapshot -c \ /var/lib/openmediavault/rsnapshot.d/rsnapshot-9941df1d-78eb-4554-a4f9-59329a06a6f5.conf \ weekly ----------------------------------------------------------------------------ERROR: Lockfile /var/run/rsnapshot-9941df1d-78eb-4554-a4f9-59329a06a6f5.pid exists and so does its process, can not continueHow can I make cron respect the given times and thereby avoid the conflict?Greetings,Martin
    • I found out, that I had no longer (like for older omv versions I think) have to add scheduled tasks manually via the gui. I removed these to get rid of the additional executions at 0:00.
      Since to my understanding the entries in /etc/cron.d/openmediavault-rsnapshot are not being used by anacron, I added the little scripts to call the rsnapshot scripts from cron.daily etc.
      I hope that works now.