[Borgbackup] Ignoring files

borgbackup-list at thomas.freit.ag borgbackup-list at thomas.freit.ag
Wed Feb 21 16:28:57 EST 2024


Hi,

I am running borg to backup several systems (mostly Linux), I try to exclude temporary or short living files. However occasionally those files are part of the logs and borg terminates with an 
non-zero returncode.

Example command:
borg create --info --show-rc --list --filter ACME --stats --patterns-from /dev/shm/borg-8d8e4e808be817cf/patterns --upload-ratelimit 0 --exclude-caches --exclude-nodump  --exclude re:'.*/temp' 
'ssh://<user>@<host>:<port>/<path>::{hostname}-{now}' /home /etc /root

Output (of a hourly run, impressive: under 5mins for about 2TB of data and about 860,000 files!):
Creating archive at "ssh://<user>@<host>:<port>/<path>::<host>-2024-02-20T08:17:01"
A /somepath/Maildir/new/23445334245.M239643453544462.host,S=96084,W=97546
A /someotherpath/Maildir/cur/645746746746.M75793935345433115.host,S=4870,W=4965:2,S
/yetanotherpath/Maildir/.INBOX.Operating.backup/dovecot-uidlist.lock: stat: [Errno 2] No such file or directory: 'dovecot-uidlist.lock'
/yetanotherpath/Maildir/.INBOX.Operating.backup/dovecot-uidlist.tmp: stat: [Errno 2] No such file or directory: 'dovecot-uidlist.tmp'
A /yetanotherpath/Maildir/new/353466456.M372671P2888743.host,S=3997,W=4089
A /yetanotherpath/Maildir/.Sent/cur/4636346363.M1835345817911.host,S=1417,W=1455:2,RS
A /yetanotherpath/Maildir/.Sent/cur/2452345235.M1210353488726.host,S=2479,W=2538:2,S
------------------------------------------------------------------------------
Repository: ssh://<user>@<host>:<port>/<path>
Archive name: host-2024-02-20T08:17:01
Archive fingerprint: aabbccddee...ff
Time (start): Tue, 2024-02-20 08:17:05
Time (end):   Tue, 2024-02-20 08:21:30
Duration: 4 minutes 25.46 seconds
Number of files: 859768
Utilization of max. archive size: 0%
------------------------------------------------------------------------------
                        Original size      Compressed size    Deduplicated size
This archive:                2.00 TB              1.98 TB              1.69 MB
All archives:              218.17 TB            215.89 TB              1.96 TB

                        Unique chunks         Total chunks
Chunk index:                 1615215            172898855
------------------------------------------------------------------------------
terminating with warning status, rc 1

Pattern file contains following lines (beside some others):
- re:.*\.lock$
- re:.*\.tmp$

Any chance to tell borg to really ignore those files, i.e. do not list them as error and quit with a zero exit code? I monitor every borg run and everytime it exits with a non-zero returncode, 
it gets escalated to me. I'd really like to ignore these errors on files, which I do not want to backup (which are on my ignore pattern list). Unforturnately using a filesystem with snapshot 
capabilities (and taking a snapshot to backup from a stable source) is not an option for most of the systems I backup.

Regards,
Thomas


More information about the Borgbackup mailing list