Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cloning scripts

Status
Not open for further replies.

morgaann

Technical User
Aug 16, 2002
47
CA
Anyone out there make use of the cloning scripts from the Networker Journal (extreme Cloning). I am having problems getting these scripts to work together. I am not a great script writer and since the company is no longer they never got a chance to provide the scripts that actually go in and find the volumes to be cloned.

If someone has done this, would you be so kind as to post the scripts that wrap around the ones provided by the Journal. By the way I am running a Networker for Unix on a Solaris box.

Any help would be appreciated.
 
It might be easier if you post what hte error you get is.
 
Sorry, I've been away on vacation.

I don't receive errors, but what I am trying to find out is if anyone has implemented the Networker Journal's Extreme cloning scripts and had it work successfully. I have all of the Journal's scripts working but what I don't know how to do is get them to work together automatically.

I can run each one manually, and they work but the problem is how to get them to run on their own and get the information required on their own. If your own scripting is involved I would appreciate and help with that since my scriping skills are very poor.


Thanks for any help.
 
I have been running the cloning scripts automatically for some time now.
I set it up as follows:-

The crontab entry

0,15,30,45 * * * * /nsr/perl/bin/perl /scripts /scripts/cloner_unix.pl >>/tmp/cloning.log 2>&1

At the end of each Legato backup scripts insert the following :-


Start_time=`eval $getdate`

su - oramrp -c "brarchive -u / -c -scd -r initMRP.utl.arch.2nd_A"

Backupname=$saveset

End_time=`eval $getdate`

echo "Start= $Start_time "

echo "End = $End_time "

host=`uname -n`

mminfo -s $host -q"name=backint:MRP,name=backint:symlinks,copies=1,client=$host,savetime>=$Start_time,
savetime<=$End_time&quot; -r volume,ssid>/tmp/arch_volumes.txt.$args

cat /tmp/arch_volumes.txt.$args

for clone in `fgrep PL /tmp/arch_volumes.txt.$args |awk '{print $1}'| sort -u`
do
if [ -r /nsr/logs/cloning/$clone.cpy ]
then
touch /nsr/logs/cloning/$clone.cpy

fgrep $clone /tmp/arch_volumes.txt.$args |awk '{print $2}'>>/nsr/logs/cloning/$clone.cpy
else
fgrep $clone /tmp/arch_volumes.txt.$args |awk '{print $2}'>/nsr/logs/cloning/$clone.cpy
fi
echo $clone
done
-----------------------------------------------

The crontab entry will then detect the creation of the *.cpy file in the directory /nsr/logs/cloning or whatever directory used in your version of cloner_unix.pl
 
Can anyone post the cloner_unix.pl here?

Thanks!
 
here is a copy of the cloner_unix.pl script.


$pool = $ARGV[0];
chomp ($pool);
#
chdir(&quot;/usr/johnj/extreme_cloning&quot;);
unlink (&quot;$pool.cleanup&quot;);
open (CLONEOUT, &quot;>$pool.cleanup&quot;);
open (MM, &quot;mminfo -r ssid -q \&quot;pool=$pool, ! incomplete,copies<2,savetime>= 24 hours ago\&quot;|&quot;) ||
die &quot;Cannot get mminfo report for ssid info\n&quot;;
@ssidinfo = <MM>;
foreach (@ssidinfo) {
print &quot;$_&quot;;
print CLONEOUT &quot;$_&quot;;
}
close(CLONEOUT);
#
system(&quot;nsrclone -s <servername> -b\&quot;$pool Clone\&quot; -S -f $pool.cleanup&quot;);
unlink (&quot;$pool.cleanup&quot;);
unlink <*.don>;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top