Tape Libraries and Drives
cancel
Showing results for 
Search instead for 
Did you mean: 

Tape Library DLT Cleaning tape Script

Gerrit Winckelmann
Occasional Advisor

Tape Library DLT Cleaning tape Script

I am planning to write a script for the cleaning tape so that it will tell me whenever it has been used for twenty times so that it notifys me when it needs to be changed. i planned to use the cleaning.log to do so, but i just havent got a functioning script yet. does anybody have a good idea how to solve this problem? any commands that i could use or maybe even a complete script already?
THX for helping!
Go Against The Flow
11 REPLIES
Leif Halvarsson_2
Honored Contributor

Re: Tape Library DLT Cleaning tape Script

Hi

Do you use barcode labels. If so you can use the label for this. Example:
label is CLNH35L1
create a file with the tape label in the log directory.




label='cat /var/opt/omni/log/label'
nr='grep $label create a file with the tape label in the log directory.

/var/opt/omni/log/cleaning.log |wc -l'
if [nr -gt 20 ]
then echo "Change cleaning tape"
fi

When you change the tape you have to edit the label file.
Leif Halvarsson_2
Honored Contributor

Re: Tape Library DLT Cleaning tape Script

Sorry,
Something got wrong. Hope this is better

Do you use barcode labels. If so you can use the label for this. Example:

label is CLNH35L1

create a file with the tape label in the log directory.

#SCRIPT#

label='cat /var/opt/omni/log/label'
nr='grep $label /var/opt/omni/log/cleaning.log |wc -l'
if [nr -gt 20 ]
then echo "Change cleaning tape"
fi

#END#

When you change the tape you have to edit the label file.
Leif Halvarsson_2
Honored Contributor

Re: Tape Library DLT Cleaning tape Script

Hi

Some modifications.

I assume yuo use OmniBack.

If you don't want to use the label file you can get this information from the library.

#SCRIPT#

label='omnimm -repository |grep "Cleaning" |awk '{print $4}'

nr='grep $label /var/opt/omni/log/cleaning.log |wc -l'
if [nr -gt 20 ]
then echo "Change cleaning tape"
fi

#END#

Gerrit Winckelmann
Occasional Advisor

Re: Tape Library DLT Cleaning tape Script

thanx for your help, i already got to work it out... but now i have another problem... what could i do if i always have the same barcode for the cleaning tape? eeven when i exchange the cleaning tape, i put the old barcode onto the new cleaning tape... thats how we are supposed to do it, dont ask me why. so, how can i solve the problem, when i always use the same barcode?
Go Against The Flow
Leif Halvarsson_2
Honored Contributor

Re: Tape Library DLT Cleaning tape Script

Hi
A simple solution. Reset the logfile when you have changed the tape. Command:
>/var/opt/omni/log/cleaning.log


Gerrit Winckelmann
Occasional Advisor

Re: Tape Library DLT Cleaning tape Script

i cant reset the logfile because there are the cleaning logs from all the other librarys in there too.... any other idea maybe?
Go Against The Flow
Leif Halvarsson_2
Honored Contributor

Re: Tape Library DLT Cleaning tape Script

Hi
This is perhaps not easy as the only way to distinguish two cleaning tapes seems to be the barcode label. You cant apply any Description, Media pool or other information to cleaning tapes. Of course it is possible to find "workarounds", for example add some information to each line with this label in the log file. Another solution could be to create a "lockfile" each time a tape is used 20 times. This lockfile is removed when the tape is replaced and then divide line numbers with 20 and use the reminder. But I don't like such workarounds, they don't seems very reliable.

I think the best solution is to buy some barcode labels, it can't be very expensive.
Gerrit Winckelmann
Occasional Advisor

Re: Tape Library DLT Cleaning tape Script

thats what i would say too, thanx for your help, ut i guess i have to use a workaround... no other way out if there are stupid rules like keeping the barcode for the librarys... but oh well.
thank you again, you already helped me enough because you gave me good ideas.
i guess i will just make a grep with tail 20 and head -1 on the cleaning tape barcode and then i compare the dates from the grep with the one from the file that will be made when a new cleaning tape is put in, that way i can see if the tape needs to bechanged or not! ;)
Go Against The Flow
Hamdy Al-Sebaey
Regular Advisor

Re: Tape Library DLT Cleaning tape Script

Gerrit,
May be my answer is outside your question, but I would like to remember you about the follownig point;
I read a document from HP in which engnieers from mentioned that you do'nt need to clean your back-up unit as long as the backup-unit does'nt ask for cleaning.
They give an advice about DLT en LTO, may be you need to clean then once every six months.
so if we say you 'll clean your backup unit twice a year then you can use your cleaning tape for 10 years(according to your script).
Regards,
Hamdy
Thanks for sharing knowledge
Gerrit Winckelmann
Occasional Advisor

Re: Tape Library DLT Cleaning tape Script

our library has 8 drives and it is used constantly 24/7 so it askes a lot more often for cleaning then twice a year...
but thank you for reminding me about that. i got the problem solved now, if anybody is interested in the script code (its not very professionell) just let me know!
Go Against The Flow
Lay Chanthavong
Occasional Contributor

Re: Tape Library DLT Cleaning tape Script

Hello Gerrit,

I'm trying to learn how to write a script for
DLT cleaning. I'm interested about the script code that you got it to worked.

Thanks
-Lay