borg backup fails due to locked repo

  • Every day, I am backing up 2 archives to the same (remote) REPO and the 2nd fails due to timing overlap.


    Code
    Remote repo 
    REPO via: ssh://XXXX:PORT/srv/RAID1/BACKUPS/Borgrepov2
    
    Archives1) GDr_remo (daily.d) — holds the lock. Starts 03:30, runs 55m, releases ~04:26.
    2) CoreALL_remo (hourly.d) — the victim. Fires 04:05, waits 1s, exits rc 2.How can I tell Archive 2 to wait instead of failing? 
    I am on Borg 1.4.0

    OMV6 HP t630

    OMV6 Xeon / i5 - SCSI PC

    OMV6 on Raspberry Pi4

    OMV5 on ProLiant N54L (AMD)

    • New
    • Official Post

    Every day, I am backing up 2 archives to the same (remote) REPO and the 2nd fails due to timing overlap.

    If you were on OMV 8 and the latest borg plugin, it would automatically wait 3600 secs.


    So, you should set BORG_LOCK_WAIT to 3600 in Environment Variables tab for that repo.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    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!

    • New
    • Official Post

    I did that (even to 7200) but borg ignores that variable.

    Not sure what the problem is. It works on omv8 https://github.com/OpenMediaVa…rgbackup/default.sls#L148


    All I can say is to upgrade. I'm not going to change anything with the omv7 version.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    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 export works but Borg <2.0 ignores that variable. Or have you ever succesfully tested the lock wait?


    As far as I understand OMV8 includes Borg 1.6 or 1.7, so upgrading OMV will unlikely fix that issue.

    OMV6 HP t630

    OMV6 Xeon / i5 - SCSI PC

    OMV6 on Raspberry Pi4

    OMV5 on ProLiant N54L (AMD)

    • New
    • Official Post

    The export works but Borg <2.0 ignores that variable. Or have you ever succesfully tested the lock wait?

    That is the problem with remembering something I added seven months ago. I found out the env variable didn't work but left it in preparation for borg 2.0 since omv8 still uses borg 1.4. The flock changes were to really fix the issue and prevent the collisions. I have tested that every single night for months on my own primary server (not dev or test) where I run four jobs at the exact same time to one local repo and three jobs at the exact same time to one remote repo. I use this plugin heavily and dogfood changes before pushing it out.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    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!

  • I see - so you implemented a workaround that prevents the collision in OMV8 by default without setting the env? Is that right?

    OMV6 HP t630

    OMV6 Xeon / i5 - SCSI PC

    OMV6 on Raspberry Pi4

    OMV5 on ProLiant N54L (AMD)

    • New
    • Official Post

    so you implemented a workaround that prevents the collision in OMV8 by default without setting the env? Is that right?

    Yes. flock is a tried and trusted tool for that exact purpose. It is not really a workaround. It is just external to borg. I use it with many scripts at work that I don't want to collide.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    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!

  • Brilliant! thank you. I will upgrade OMV and try it.

    (I am surprised that you had to go through implementing this and Borg doesn manage that by itself. Backup task overlap is such a common issue because you never really know how long a job will run and Borg could just manage a FIFO queue)

    OMV6 HP t630

    OMV6 Xeon / i5 - SCSI PC

    OMV6 on Raspberry Pi4

    OMV5 on ProLiant N54L (AMD)

    • New
    • Official Post

    I am surprised that you had to go through implementing this and Borg doesn manage that by itself.

    It would make sense. I guess they just assume people will create their own queue. This problem wasn't a problem in earlier borg plugin versions because people couldn't change the time the tasks ran. cron kicked off a run-parts (just run all jobs in hourly directory for example) which would run the jobs serially.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    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!

Participate now!

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