The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Finding 'duplicate' Bacula volume names
Author: Dan 
Date:   27-02-12 02:31

I had a bunch of tapes that I had labelled manually. Later, I got a tape library, which could read tape labels. Thus, I wanted to relabel the tapes, but had to delete the old volumes from the Bacula database. First, I needed to know what tapes where relabeled. This query told me that.

Fortunately, the labels I used manually were based on the bar code label.

SELECT media.volumename as NEW, M.volumename as OLD
FROM media, (SELECT volumename, substr(volumename, 9) || 'S2' AS newmedianame
FROM media M
WHERE volumename LIKE 'DLT7000-JYN%') AS M
WHERE media.volumename = m.newmedianame
order by 2

--
Webmaster

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org