Squidly271 / ca.backup2

3 stars 6 forks source link

The error notifications are not working #5

Open Commifreak opened 2 years ago

Commifreak commented 2 years ago

While creating the PR #4 I noticed, that the verify success check is not working. Since the command is like:

cd '/mnt/user/appdata/' && /usr/bin/tar --diff -C '/mnt/user/appdata/' -af '/mnt/disks/92E6P00LT/appdata/2022-09-07@09.40/CA_backup.tar' >> /var/lib/docker/unraid/ca.backup2.datastore/appdata_backup.log 2>&1 & echo $! > /tmp/ca.backup2/tempFiles/verifyInProgress

and the script checks THAT returncode, it is always 0, because the stored returncode is the one of the echo $!. The tar error is never captured - but its there!

[07.09.2022 09:40:57] Verifying Backup
[07.09.2022 09:40:57] Using command: cd '/mnt/user/appdata/' && /usr/bin/tar --diff -C '/mnt/user/appdata/' -af '/mnt/disks/92E6P00LT/appdata/2022-09-07@09.40/CA_backup.tar' >> /var/lib/docker/unraid/ca.backup2.datastore/appdata_backup.log 2>&1 & echo $! > /tmp/ca.backup2/tempFiles/verifyInProgress
/usr/bin/tar: This does not look like a tar archive
/usr/bin/tar: Exiting with failure status due to previous errors
[07.09.2022 09:40:57] Starting xxx
[07.09.2022 09:40:59] Backup/Restore Complete.  tar Return Value: 0

I still try to solve this as well (I create another PR if I find a quick solution) and wanted to note that here already.

The solution to this one also should check the initial tar creation success

Commifreak commented 2 years ago

Found a solution - tested all cases - works fine now.

Commifreak commented 2 years ago

Anything new on this? In my eyes the check is currently broken and not reliable without #6 . If not, please tell me :)