* Major changes from Ryan Kucera to add style sheets to the CGI
[BackupPC.git] / bin / BackupPC_dump
index d1509b7..f59e38a 100755 (executable)
@@ -126,20 +126,19 @@ if ( $opts{d} ) {
     #
     $hostIP = $client;
     if ( $bpc->CheckHostAlive($hostIP) < 0 ) {
     #
     $hostIP = $client;
     if ( $bpc->CheckHostAlive($hostIP) < 0 ) {
-       print("Exiting because CheckHostAlive($hostIP) failed\n")
+       print(STDERR "Exiting because CheckHostAlive($hostIP) failed\n")
                            if ( $opts{v} );
        exit(1);
     }
     if ( $Conf{NmbLookupCmd} eq "" ) {
                            if ( $opts{v} );
        exit(1);
     }
     if ( $Conf{NmbLookupCmd} eq "" ) {
-       print("Exiting because \$Conf{NmbLookupCmd} is empty\n")
+       print(STDERR "Exiting because \$Conf{NmbLookupCmd} is empty\n")
                            if ( $opts{v} );
        exit(1);
     }
     ($client, $user) = $bpc->NetBiosInfoGet($hostIP);
     if ( $client !~ /^([\w\.\s-]+)$/ ) {
                            if ( $opts{v} );
        exit(1);
     }
     ($client, $user) = $bpc->NetBiosInfoGet($hostIP);
     if ( $client !~ /^([\w\.\s-]+)$/ ) {
-       print("Exiting because NetBiosInfoGet($hostIP) returned '$client',"
-           . " an invalid host name\n")
-                           if ( $opts{v} );
+       print(STDERR "Exiting because NetBiosInfoGet($hostIP) returned"
+                   . " '$client', an invalid host name\n") if ( $opts{v} );
        exit(1)
     }
     $Hosts = $bpc->HostInfoRead($client);
        exit(1)
     }
     $Hosts = $bpc->HostInfoRead($client);
@@ -148,8 +147,8 @@ if ( $opts{d} ) {
     $Hosts = $bpc->HostInfoRead($client);
 }
 if ( !defined($Hosts->{$client}) ) {
     $Hosts = $bpc->HostInfoRead($client);
 }
 if ( !defined($Hosts->{$client}) ) {
-    print("Exiting because host $client does not exist in the hosts file\n")
-                           if ( $opts{v} );
+    print(STDERR "Exiting because host $client does not exist in the"
+               . " hosts file\n") if ( $opts{v} );
     exit(1)
 }
 
     exit(1)
 }
 
@@ -200,6 +199,13 @@ if ( $opts{e} ) {
     exit(0);
 }
 
     exit(0);
 }
 
+#
+# For archive hosts we don't bother any further
+#
+if ($Conf{XferMethod} eq "archive" ) {
+    exit(0);
+}
+
 if ( !$opts{d} ) {
     #
     # In the non-DHCP case, make sure the host can be looked up
 if ( !$opts{d} ) {
     #
     # In the non-DHCP case, make sure the host can be looked up
@@ -215,7 +221,7 @@ if ( !$opts{d} ) {
         # Ok, NS doesn't know about it.  Maybe it is a NetBios name
         # instead.
         #
         # Ok, NS doesn't know about it.  Maybe it is a NetBios name
         # instead.
         #
-       print("Name server doesn't know about $host; trying NetBios\n")
+       print(STDERR "Name server doesn't know about $host; trying NetBios\n")
                        if ( $opts{v} );
         if ( !defined($hostIP = $bpc->NetBiosHostIPFind($host)) ) {
            print(LOG $bpc->timeStamp, "Can't find host $host via netbios\n");
                        if ( $opts{v} );
         if ( !defined($hostIP = $bpc->NetBiosHostIPFind($host)) ) {
            print(LOG $bpc->timeStamp, "Can't find host $host via netbios\n");
@@ -253,7 +259,7 @@ $bpc->ServerDisconnect();
 if ( $opts{d} ) {
     if ( $StatusHost{activeJob} ) {
         # oops, something is already running for this host
 if ( $opts{d} ) {
     if ( $StatusHost{activeJob} ) {
         # oops, something is already running for this host
-       print("Exiting because backup is already running for $client\n")
+       print(STDERR "Exiting because backup is already running for $client\n")
                        if ( $opts{v} );
         exit(0);
     }
                        if ( $opts{v} );
         exit(0);
     }