-#!/bin/perl
+#!/usr/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_archiveStart: start an archive request from the
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2007 Craig Barratt
+# Copyright (C) 2007-2009 Craig Barratt
#
# 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 3.2.0, released 31 Dec 2008.
+# Version 3.2.0, released 31 Jul 2010.
#
# See http://backuppc.sourceforge.net.
#
# no options currently
if ( !getopts("", \%opts) || @ARGV < 3 ) {
print STDERR <<EOF;
-usage: $0 archiveHost userName hosts...
+usage: $0 archiveHost userName hosts[:num]...
EOF
exit(1);
}
my(@HostList, @BackupList);
for ( my $i = 2 ; $i < @ARGV ; $i++ ) {
- my $host = $ARGV[$i];
+ my ($host,$num) = split(/:/,$ARGV[$i],2);
if ( !defined($Hosts->{$host}) ) {
print(STDERR "$0: host $host doesn't exist... quitting\n");
exit(1);
exit(1);
}
push(@HostList, $host);
- push(@BackupList, $backups[$#backups]{num});
+ $num ||= $backups[$#backups]{num};
+ push(@BackupList, $num);
}
my $ReqFileName;
my %ArchiveReq = (
archiveloc => $bpc->{Conf}{ArchiveDest},
archtype => 0,
- compression => $bpc->{Conf}{ArchiveComp} eq "none" ? $bpc->{Conf}{CatPath}
- : $bpc->{Conf}{ArchiveComp},
- compext => $bpc->{Conf}{ArchiveComp} eq "none" ? '.raw' : '.gz',
+ compression => $bpc->{Conf}{ArchiveComp} eq 'none' ? $bpc->{Conf}{CatPath}
+ : ($bpc->{Conf}{ArchiveComp} eq 'gzip'
+ ? $bpc->{Conf}{GzipPath} : $bpc->{Conf}{Bzip2Path}),
+ compext => $bpc->{Conf}{ArchiveComp} eq 'none' ? ''
+ : ($bpc->{Conf}{ArchiveComp} eq 'gzip' ? '.gz' : '.bz2'),
parfile => $bpc->{Conf}{ArchivePar},
splitsize => '0000000',
host => $ArchiveHost,