Automatically write protect media

Here you can write your Problems with Backups.

Moderator: sepma

Post Reply
wfellows
Posts: 5
Joined: June 14th, 2011, 12:18 pm
Spam Stop: No
SEP sesam: Software

Automatically write protect media

Post by wfellows » February 10th, 2012, 5:48 pm

I'm looking for a way to automatically enable the write protect feature on media after a backup has completed. I've attempted to add 'sm_cmd modify media' commands to the post task file, but this doesn't appear to do anything.

To further complicate matters, I would like to write protect the media after all the tasks in a task group have completed - they all write to the same tape.

Any pointers or walkthroughs would be greatly appreciated.

For reference:
Sesam GUI Client V4.0 Build 5
Sesam GUI Server V4.0 Build 5
Kernel: server,4.0.2.13,20110723131300
running on SLES10

jgb
Posts: 55
Joined: June 27th, 2011, 11:11 am
Spam Stop: No
SEP sesam: Software

Re: Automatically write protect media

Post by jgb » February 20th, 2012, 12:53 pm

Hi,

the command for locking the media is:

sm_cmd modify media <media label> -k -

You can unlock the media with:

sm_cmd modify media <media label> -k +

You know, this command write protects the media "for ever" ! You must unlock ist manually in the GUI or with the sm_cmd... command.

Best way to lock the media automatically is to use the notify interface and there the "ALL_JOBS_DONE" Event.

JGB

wfellows
Posts: 5
Joined: June 14th, 2011, 12:18 pm
Spam Stop: No
SEP sesam: Software

Re: Automatically write protect media

Post by wfellows » February 20th, 2012, 1:13 pm

Is there a parameter that can be passed/used within the notify interface for the "ALL_JOBS_DONE" event that will allow me to only lock the media that was used by that job, or must I manually specify the media name? I do want the media to be permanently write protected to the system as I have a particular job set up that I want each individual run of to be in the same pool, but to individual media. I don't want SEP to append the start of the new job onto the end of a previously used media.

jgb
Posts: 55
Joined: June 27th, 2011, 11:11 am
Spam Stop: No
SEP sesam: Software

Re: Automatically write protect media

Post by jgb » February 20th, 2012, 1:43 pm

Hi,

you must manually specify the media name (label). At first you must know wich media was used. There is a little sample script in the SEP Wiki.

http://wiki.sepsoftware.com/wiki/index. ... _Sesam_Day

Modify the scipt, so that the result of the DB query doesn't send as an e-mail but store the result in a variable for instance used_media (or in an array, if more than one media was used)

Then use this variable with the command.

sm_cmd modify media $used_media -k -

If you "only" want that Sesam use a new (the next free) media, you can create a scheduled media event ("close tape" or "init") on the media pool. With "close tape" Sesam will close all active medias of the selected media pool und set the EOL (End of Live) regarding the value defined at the media pool. "Init" will not only close the media(s), it will also initialize the next to use media for the pool (set the oldest, not EOL marked media to state active).

JGB

Post Reply