[Borgbackup] Return Code for borg break-lock

Kevin Hilton kevhilton at gmail.com
Sun Nov 10 23:33:34 EST 2019


Hi -- I've been using BB for about 3 years -- Simple setup which I use as a
cron script to backup Laptop to NAS server.  Everything working great so
far.
I recently discovered Vorta for BorgBackup and I really like the
interface.  I'm not sure how long this tool has been available however I'm
in the process of testing this as an alternative to MacBook's Time
Machine.

Looking at my bash old script which I composed several years ago, I often
ran the borg break-lock command prior to borg create command -- Here is
snippet:

REPOSITORY="ssh://<user>@freenas/~/backup/borg/borgMacBookKMH-FreeNAS"
OPTIONS="--progress --debug --stats --compression lzma,9 --exclude-caches"
#Ive taken out the --progress option when run in a cron job
export BORG_PASSPHRASE="****"

borg break-lock $REPOSITORY

borg create $OPTIONS $REPOSITORY::`hostname`-`date +%Y-%m-%d--%H:%M:%S` \
  /Users/<user> \
  --exclude '*/.cache/*' \
  --exclude '*/.Cache/' \
  --exclude '*/.Trash/' \
 ...
....

I remember having to add this break-lock command since when I was composing
this script several years ago, the script would hang either due to a
network issue or ssh issue or some other issue. After hanging, the
repository would be locked and subsequent cron jobs running the script
wouldn't actually backup anything.

There also seems to not be any return code for this function -- or maybe
I'm not seeing it when it runs with success -- like a zero.

My questions are as follows:
1. Does borg break-lock return 0 on success?
2. Do I still require this statement with newer borg versions? I'm
currently running version 1.1.10
3. Vorta has an option that I can run Pre Backup Command -- but requires a
return code of 0 to proceed with the borg backup command.  I was thinking
of running the break-lock command here, however when trying this particular
method, the program notifies me it receives a non-zero return code.
4. Maybe I'm just doing things incorrectly.  I'm open to comments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20191110/52eab330/attachment.html>


More information about the Borgbackup mailing list