-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_zipCreate: create a zip archive of an existing dump
# Based on Backup_tarCreate by Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2002 Craig Barratt and Guillaume Filion
+# Copyright (C) 2002-2003 Craig Barratt and Guillaume Filion
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
#========================================================================
#
-# Version 1.6.0_CVS, released 10 Dec 2002.
+# Version 2.1.0beta1, released 9 Apr 2004.
#
# See http://backuppc.sourceforge.net.
#
#========================================================================
use strict;
+no utf8;
use lib "/usr/local/BackupPC/lib";
use Archive::Zip qw(:ERROR_CODES);
use File::Path;
my %Conf = $bpc->Conf();
my %opts;
-getopts("th:n:p:r:s:c:", \%opts);
-if ( @ARGV < 1 ) {
+if ( !getopts("th:n:p:r:s:c:", \%opts) || @ARGV < 1 ) {
print(STDERR "usage: $0 [-t] [-h host] [-n dumpNum] [-s shareName]"
. " [-r pathRemove] [-p pathAdd] [-c compressionLevel]"
. " files/directories...\n");
exit(1);
}
-if ( $opts{h} !~ /^([\w\.-]+)$/ ) {
+if ( $opts{h} !~ /^([\w\.\s-]+)$/ ) {
print(STDERR "$0: bad host name '$opts{h}'\n");
exit(1);
}
$fh->fdopen(fileno(STDOUT),"w");
my $zipfh = Archive::Zip->new();
+binmode(STDOUT);
foreach my $dir ( @ARGV ) {
archiveWrite($zipfh, $dir);
}