#!/usr/local/bin/perl # This acts as a high-level wrapper for GNU tar. By changing # where_on_earth_is_gnu_tar you can cause different actions to # take place based on exactly what's being dumped. # Hacked together by Matt McLeod # See http://boggle.org/software/ for license details. # configuration $real_tar = "/usr/local/gnu/bin/tar"; # this sub is the meat of it. you almost certainly want to # customize this. The path to be backed-up is passed in, # it should return the path to the thing to call in place # of GNU tar. sub where_on_earth_is_gnu_tar { local ($source) = @_; $gnu_tar = $real_tar; if ($source =~ /^\/proj\/ASAC/) { $gnu_tar = "/opt/amanda/support/ccase-cpio"; } elsif ($source =~ /^\/vobs/) { $gnu_tar = "/opt/amanda/support/ccase-cpio"; }; return $gnu_tar; }; @args = @ARGV; while ($n = shift) { if ($n eq "--directory") { $source = shift; }; }; $tar = where_on_earth_is_gnu_tar($source); system("$tar @args");