Help with Script/Cron job

Recently set up external USB drives for backup-to-disk with latest 
version of Backup Exec (9.2?) for Netware OES 6.5 server.  Backup jobs 
run great so far but I would like to automate the process of 
deactivating the pool and then dismounting the volume at the end of the 
week so my client can then just plug in the 2nd USB drive (same Volume 
and Pool name) for the next week of back up jobs.  Anyone out there have 
any pointers or resources for doing so?

TIA,

Ben
0
Ben
8/12/2007 5:44:12 PM
novell.netware.6x.server 4070 articles. 0 followers. Follow

8 Replies
434 Views

Similar Articles

[PageSpeed] 44

Ben Lewis,

So do you want this to pre-executed before the backup job starts or do you
wanna have it like a command, that can be executed manually when  at the
end of each week when it's time to replace the drive?


-- 
___________________________________________
Niclas Ekstedt, CNA/CNE/CNS/CLS
Systems Engineer/NSC Sysop
Telindus Göteborg AB

Telindus. Change things your way
http://www.telindus.com/
0
Niclas
8/12/2007 9:22:11 PM
Niclas Ekstedt wrote:
> Ben Lewis,
> 
> So do you want this to pre-executed before the backup job starts or do you
> wanna have it like a command, that can be executed manually when  at the
> end of each week when it's time to replace the drive?
> 
> 
Ideally, I'd like it to execute post-Friday backup and pre-Monday backup 
on the following week.
0
Ben
8/13/2007 10:29:31 PM
Ben Lewis,

Is this BackupExec running on Windows, if so I do not think it'll
be able to actually execute pre/post scripts on Linux.
All that's needed is for the the shell script to dismount the volume
deactivate the pool, prompt the user to replace the drive, mount the
drive and activate pool and mount volume.


-- 
___________________________________________
Niclas Ekstedt, CNA/CNE/CNS/CLS
Systems Engineer/NSC Sysop
Telindus Göteborg AB

Telindus. Change things your way
http://www.telindus.com/
0
Niclas
8/14/2007 8:36:41 AM
Niclas Ekstedt wrote:
> Ben Lewis,
> 
> Is this BackupExec running on Windows, if so I do not think it'll
> be able to actually execute pre/post scripts on Linux.
> All that's needed is for the the shell script to dismount the volume
> deactivate the pool, prompt the user to replace the drive, mount the
> drive and activate pool and mount volume.
> 
> 
No, it's running on the OES (Netware) server.  Right, that's what I was 
thinking, but I don't know the commands to write said script.
0
Ben
8/14/2007 1:42:25 PM
>> Is this BackupExec running on Windows, if so I do not think it'll
>> be able to actually execute pre/post scripts on Linux.
>> All that's needed is for the the shell script to dismount the volume
>> deactivate the pool, prompt the user to replace the drive, mount the
>> drive and activate pool and mount volume.
>> 
>> 
> No, it's running on the OES (Netware) server.  Right, that's what I was 
> thinking, but I don't know the commands to write said script.

I haven't used BackupExec in some time on NetWare.  However, if the 
BackupExec process loads a particular NLM while running the job you can 
write a Perl script to check to see if that NLM is loaded.  If the NLM is 
not loaded dismount the volume, deactivate the pool, prompt the user (or 
maybe email someone), then  mount the drive and activate the pool when the 
user comes back and hits enter (or some other input).  

There might be other ways to check for BackupExec results too (log 
parsing)?  

Ryan




0
rkather
8/15/2007 12:49:18 PM
> I haven't used BackupExec in some time on NetWare.  However, if the 
> BackupExec process loads a particular NLM while running the job you can 
> write a Perl script to check to see if that NLM is loaded.  If the NLM is 
> not loaded dismount the volume, deactivate the pool, prompt the user (or 
> maybe email someone), then  mount the drive and activate the pool when the 
> user comes back and hits enter (or some other input).  

I guess I should post some sample code for checking module status;

# Define the name of the module to look for
$nlm="TRUSTEE.NLM";

# The NRM XML file that keeps a note of which modules are loaded
$nrm_file="_admin:/Novell/NRM/NRMModules.xml";

$nlm_running=get_module_status($nlm);
     while ($nlm_running==1) {
        # print "$nlm is running. Waiting $delay secondsn";        
        sleep($delay);
        $nlm_running=get_module_status($nlm);        
     }

#
# Get Module Load Status
#

sub get_module_status 
{
  # Check whether a nlm is loaded. Returns 0 if not running, >=1 otherwise
  # Relies on NRM XML files
  #
  # Input:  Name of NLM to test (case sensitive)
  # Outout: Number of instances found (zero if not found)

  my $COUNT=0;
  open nrmfile, "<$nrm_file"  or die "Unable to open $nrm_file. Is NSS 
loaded?";
  while (<nrmfile>) {if (/$_[0]/) {++$COUNT}}
  close nrmfile;
  return $COUNT;
}

Then you can either run the system commands directly to work on volumes 
and pools; or you could use the ADMIN volume to manipulate XML (like how 
we testd for running module).  

Ryan

0
rkather
8/16/2007 3:41:29 PM
Ben Lewis,

Sorry for taking so long to get back to you on this.
Anyway a simple NCF file to be executed manually on the server should do
the tick. It could look something like this.


dismount <volume>
nss /pooldeactive=<pool>
echho Replace the USB drive!
pause
scan for new devices
nss /poolactivate=<pool>
mount <volume>


-- 
___________________________________________
Niclas Ekstedt, CNA/CNE/CNS/CLS
Systems Engineer/NSC Sysop
Telindus Göteborg AB

Telindus. Change things your way
http://www.telindus.com/
0
Niclas
8/20/2007 1:28:21 PM
Niclas Ekstedt wrote:
> Ben Lewis,
> 
> Sorry for taking so long to get back to you on this.
> Anyway a simple NCF file to be executed manually on the server should do
> the tick. It could look something like this.
> 
> 
> dismount <volume>
> nss /pooldeactive=<pool>
> echho Replace the USB drive!
> pause
> scan for new devices
> nss /poolactivate=<pool>
> mount <volume>
> 
> 
Niclas,

Thanks so much for that.  I couldn't get it completed automated due to a 
problem with backup exec, but with your help, I got it down to executing 
a couple of commands at the console.

Thanks so much!
0
Ben
9/8/2007 3:02:33 AM
Reply: