--- foxridge-archiver/unarchiver.pl 2005/03/23 12:12:08 1.4 +++ foxridge-archiver/unarchiver.pl 2017/03/16 17:00:43 1.9 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w use strict; @@ -18,7 +18,7 @@ $|=1; # # program version -my $version = "0.3 (20.1.2005)"; +my $version = "0.3.4 (11.8.2009)"; # read command line parameters my $args = parseargs; @@ -196,14 +196,17 @@ sub run_retrieve { # destination dir is mount point $archparent = $archmount; } + logger("INFO", "looking for archives in $archmount..."); print LOG "START unarchive $version on ", scalar localtime, "\n"; my $archcmd = $archprog; - $archcmd .= " retrieve -subdir=yes -replace=all"; + $archcmd .= " retrieve -subdir=yes -replace=all -ifnewer"; $archcmd .= " -description='$archname'"; # archive name $archcmd .= " '$archmount/'"; # archive mount point $archcmd .= " '$archparent/'"; # destination dir name + logger('INFO', "querying TSM server for $archmount, please wait..."); + my $archcnt = 0; my $numfiles = 0; print LOG "CMD: $archcmd\n"; @@ -296,7 +299,7 @@ sub check_files { logger("INFO", "unarchiver $version"); # make shure the right user is running this program -my $user = getlogin; +my $user = getlogin || getpwuid($<); if (($user)&&($user ne "archive")&&($user ne "root")) { logger("ABORT", "you must be archive or root user to run this program!"); exit 1;