Jump to content
Sign in to follow this  


Recommended Posts

A simple script, but a handy one if you maintain servers.

One of the issues I always encounter is that of onsite staff not understanding tape-backup schemes. You can lecture to them 'til the cows come home, prepare all sorts of fancy diagrams, etc... and still, all you get is blank stares, and the same tape used over again each day.

OK, so one answer might be a tape mag, but they cost serious bucks, and aren't always too reliable. Less costly, a script which tells the operator which tape to insert, based on the date. Operator runs script on own computer. Picks tape with correct label. Inserts into server. Easy.

; Tape Rotator by Anteaus, Oct 2007.
; Released under GPL. 
; Calculates tape required for rotational backup.

; As-supplied, is designed for a Four-Weekday (Mon-Thu), Four-Friday and Twelve-Monthly tape set,
; but should be easy enough to reconfigure for other schemes. 


; Optionally add cmdline-input here to allow checking of other dates. 

$MonthNames = stringSplit("January,February,March,April,May,June,July,August,September,October,November,December",",")

$tapeSet = "N/A"
$tapeName= "No Backup Today"

 case ($wkDay > 1) and ($wkDay < 6)
   $tapeSet="Daily Tapes"
 case $wkDay=6
  if ($daysThisMonth - $bkDay) < 7 then  
   $tapeSet="Month-End Tapes"
   $tapeSet="Week-End Tapes"
   $tapeName=$dayName & " " & tapeOrdinal($bkDay)

msgbox(0,"-: Backup Tape Selector :- ", "Tape Set: " & $tapeSet & @cr & @cr & "Tape Name: " & $tapeName,30)


; ----------------------------------------------------------

func TapeOrdinal($bkDay)
  $thisOrdinal=int($weeksElapsed) + 1
  return $thisOrdinalName

func yDays($thisYear)
  Case Mod($thisYear,4) = 0 And Mod($thisYear,100) <> 0
  Case Mod($thisYear, 400) = 0
  Case Else
 return $ctYDays

func daysinMonth($thisYear,$thisMonth)
; requires: func yDays()
  Local $xpMDays=stringSplit("31,28,31,30,31,30,31,31,30,31,30,31",",")
  if yDays($thisYear)=366 then $xpMDays[2]=29
  return $daysinthisMonth

Compatibility: Compile with Aut2EXE 3.2 or higher.

Edited by Anteaus

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...