rustic icon indicating copy to clipboard operation
rustic copied to clipboard

`rustic check` reports ERROR but returns 0 exit code

Open kapitainsky opened this issue 1 year ago • 1 comments

$ rustic --version
rustic 0.8.1

$ rustic check
[INFO] using config ./rustic.toml
[INFO] repository rclone:OD01-ENC:rustic_kptsky_backup: password is correct.
[INFO] using cache at /Users/kptsky/Library/Caches/rustic/75d391929ae92a6d1f797a8725950e8ac8a59424dbbdb4df5db1f06a8d87f348
[00:00:00] checking Snapshot in cache...  ████████████████████████████████████████   3.10 KiB/3.10 KiB   1.30 MiB/s   (ETA -)
[00:00:00] checking Index in cache...     ████████████████████████████████████████  14.22 MiB/14.22 MiB  1.24 GiB/s   (ETA -)
[00:00:01] reading index...               ████████████████████████████████████████         10/10                                                                               [00:00:00] listing packs...               ⠁                                                                                                                                    
[ERROR] pack 8213a0ba: size computed by index: 36, actual size: 17074311. To repair: 'rustic repair index'.
[00:05:31] listing packs...
[00:00:00] cleaning up packs from cache...
[00:03:47] checking packs in cache...     ████████████████████████████████████████   1.30 GiB/1.30 GiB   5.85 MiB/s   (ETA -)
[00:00:02] reading snapshots...           ████████████████████████████████████████          5/5
[00:00:21] checking trees...              ████████████████████████████████████████          5/5

$ echo $?
0

so either it is not an ERROR but WARNING(?) or returned code is wrong. It makes very difficult to script rustic operations if returned error codes do not reflect reality and manual logs reading is required.

kapitainsky avatar Sep 12 '24 06:09 kapitainsky