not entirely sure...
authorpaulr <me@pjr.cc>
Mon, 12 Jul 2010 00:42:45 +0000 (10:42 +1000)
committerpaulr <me@pjr.cc>
Mon, 12 Jul 2010 00:42:45 +0000 (10:42 +1000)
bin/pbdc
bin/pbdc-bacula
bin/pbdc.php

index 95ca1af..8724026 100644 (file)
--- a/bin/pbdc
+++ b/bin/pbdc
@@ -1,3 +1,5 @@
 #!/bin/sh
 
-php pbdc.php $*
\ No newline at end of file
+BASE_DIR="/home/paulr/src/eclipse-workspace/php-bacula-disk-changer/bin/"
+
+php $BASE_DIR/pbdc.php $*
\ No newline at end of file
index b3e6c20..51a14b4 100644 (file)
@@ -1,3 +1,5 @@
 #!/bin/sh
 
-php pbdc-bacula.php $*
\ No newline at end of file
+BASE_DIR="/home/paulr/src/eclipse-workspace/php-bacula-disk-changer/bin/"
+
+php $BASE_DIR/pbdc-bacula.php $*
\ No newline at end of file
index 0e66657..4aad1e0 100644 (file)
@@ -49,7 +49,38 @@ function bacula_config()
 
        $db = db_getDB($argv[1]);
        
+       $ntapes = conf_getVal($changer, "ndrives");
+       $tapeloc = conf_getVal($changer, "drivelocation");
+       
        // TODO: do this bit
+       // bacula-sd.conf
+       ?>
+Autochanger {
+  Name = <?php echo "$changer\n"?>
+  <?php
+  for($i=0; $i<$ntapes; $i++) {
+       echo "Device = \"$changer-drive$i\"\n";
+  } 
+  ?>
+  Changer Command = "/usr/local/bin/vchanger %c %o %S %a %d"
+  Changer Device = "<?php echo $changer ?>"
+}
+
+<?php 
+       for($i=0; $i < $ntapes; $i++) {
+?>
+Device {
+  Name = <?php echo "\"$changer-drive$i\"\n" ?>
+  DriveIndex = <?php echo $i ?>
+  Autochanger = yes;
+  DeviceType = File
+  MediaType = File
+  ArchiveDevice = <?php echo "\"$tapeloc/$changer-drive$i\"\n" ?>
+  RemovableMedia = no;
+  RandomAccess = yes;
+}
+<?php
+       }
 }
 
 function pbdc_status()