Backing up /data Errors were encountered during backup - ABORTING

Below is part of the error message showing on /var/mail/root.

Backing up /data
Errors were encountered during backup - ABORTING

Where or how would I find the errors causing the backup to abort

May we know the backup app or tool that is causing this error?

We use tar.
Thank you in advance

You need to run your tar command manually (not from cron or script) and see what causing error. It will show it on the screen. Say

tar -zcf /path/to/backup.tar.gz /dir1 /dir2

This is the only way to see errors. Typically file permissions cause such errors.

Thank you so much for your response. I’ve noted your comments which are very helpful. Just on another note, I guess this would have to be done after hours and before the night sequence sets in right? Also if I were to extract (tar -zxvf *.tar.gz), the current backup to test company, could I test running the tar command you’ve stated using the same live data in test data set to test the directories to pickup any errors.

Yes, you can disable cronjob temporarily so that it will not interfere with your running command manually. Alternatively, one can log everything to a log file. I am assuming it is a bash script that is called, one can put three line at top of the the script to log everything

#!/bin/bash
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>/var/log/my-backup-script.log 2>&1
# rest of the script below
# tar ....

Then later, you can examine /var/log/my-backup-script.log for errors. Another option is to see it manually by running the tar command from CLI, as mentioned by @monk.

Also if I were to extract (tar -zxvf *.tar.gz), the current backup to test company, could I test running the tar command you’ve stated using the same live data in test data set to test the directories to pickup any errors.

Yes, you need to use the same data. Maybe pass the -t to list the contents of an archive but extracting and running diff would be best:

tar -tzf your-file.tar.gz

There is also --verify option for GNU/tar on Linux. But, you cannnot verify compressed archives.
Check documentation GNU tar 1.34: 9.8 Verifying Data as It is Stored

Thank you so much for this information @nixcraft. Will try this out and see how we go. Much appreciated. :+1:

Can I suggest a tool? I am using borg, to backup my data. It is free, and much more flexible than tar. Of course, you must configure it, you must spend some time to learn, etc. But t’s worth it!

Thanks for the suggestion @ivandb. Will read more about it. Cheers


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki