# HG changeset patch # User casties # Date 1095969344 -7200 # Node ID c4e6fc065b6d24dbb9ef224429cfc219cebea483 # Parent a3feffd94021993f392c2c3db5e6039851a6edb1 fixed problem with dsmc because of new filespace. uses excplicit destination directory now. diff -r a3feffd94021 -r c4e6fc065b6d unarchiver.pl --- a/unarchiver.pl Tue Jul 13 20:32:49 2004 +0200 +++ b/unarchiver.pl Thu Sep 23 21:55:44 2004 +0200 @@ -3,6 +3,7 @@ use strict; use XML::LibXML; +use FileHandle; # MPIWG libraries use lib '/usr/local/mpiwg/archive'; @@ -17,7 +18,7 @@ # # program version -my $version = "0.1 (24.9.2003)"; +my $version = "0.2 (23.9.2004)"; # read command line parameters my $args = parseargs; @@ -55,6 +56,7 @@ logger("ABORT", "unable to write log file '$log_file'!!"); exit 1; } +LOG->autoflush(1); ####################################################### # check parameters that were passed to the program @@ -77,6 +79,9 @@ exit 1; } +# construct document's parent dir +my $docparent = $docdir; +$docparent =~ s!/[^/]+$!!; ####################################################### # internal variables @@ -172,15 +177,16 @@ # runs the retriever program on $docdir and returns a list of archived files # # Sample output: -# Retrieving 17,234 /mpiwg/archive/data/test/auto_titit_123/pageimg/essen-wind1.jpg [Done] -# +# (old!) Retrieving 17,234 /mpiwg/archive/data/test/auto_titit_123/pageimg/essen-wind1.jpg [Done] +# Retrieving 42,406,326 /mpiwg/archive/data/library/B980G582/raw/00015.tif --> /mpiwg/archive/data/library/B980G582/raw/00015.tif [Done] sub run_retrieve { my %files; - print LOG "START unarchive $version ", scalar localtime, "\n"; + print LOG "START unarchive $version on ", scalar localtime, "\n"; my $archcmd = $archprog; $archcmd .= " retrieve -subdir=yes -replace=all"; $archcmd .= " -description='$archname'"; - $archcmd .= " '$docdir/'"; + $archcmd .= " '$docdir/'"; # archive name + $archcmd .= " '$docparent/'"; # destination dir name my $archcnt = 0; print LOG "CMD: $archcmd\n"; @@ -192,6 +198,8 @@ Retrieving \s+([\d,]+) # size \s+(\S+) # file name + \s+--> + \s+(\S+) # destination file name \s+\[Done\] /x) { my $size = $1; @@ -271,7 +279,7 @@ # make shure the right user is running this program my $user = getlogin; -if (($user ne "archive")&&($user ne "root")) { +if (($user)&&($user ne "archive")&&($user ne "root")) { logger("ABORT", "you must be archive or root user to run this program!"); exit 1; }