On 17/06/2024 18:50, Bill Arlofski via Bacula-users wrote:
Hello Adam,
Not sure if this will be any help at all, but I just checked and see
that in my `mtx-changer-python.py` drop-in replacement script, to check
for tape cleaning required messages, I am using:
----8<----
sg_logs --page=0xc /dev/sg##
----8<----
Then I look for:
----8<----
Cleaning action not required (or completed)
or
Cleaning action required
----8<----
To determine if I need to automatically find and load a cleaning tape
before returning contr
ol to the SD...
I had been using `tapealert` instead of sg_logs, but I found that
tapeinfo clears all alert messages on the drive, so they could never be
caught by the SD when it calls tapeinfo in the tapealert script. Sg_logs
just reports what I need without clearing the other flags that the SD
needs to know when a drive or tape is bad/damaged, etc.
Best regards,
Bill
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
OMG...
The only reason the script started failing was a different device
assignment caused by a reboot:
ls -al /dev | grep sg.
crw-rw---- 1 root tape 21, 0 Jun 19 12:25 sg0
crw-rw---- 1 root disk 21, 1 Jun 12 17:42 sg1
Once I've changed sg1 to sg0 it started working like a charm again :)
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users