]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix update catalog problems + Mark bscan Vols as Archive
authorKern Sibbald <kern@sibbald.com>
Fri, 28 Nov 2003 18:25:45 +0000 (18:25 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 28 Nov 2003 18:25:45 +0000 (18:25 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@817 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_sqlite_tables.in
bacula/src/cats/update_mysql_tables.in
bacula/src/cats/update_sqlite_tables.in
bacula/src/stored/bacula-sd.conf.in
bacula/src/stored/bscan.c

index 91207688a165c2ee4a7cb9f5875f84aff00eaa49..b5b9052e1b52899c9f42e10d0df320c9d596f563 100644 (file)
@@ -1551,9 +1551,10 @@ chmod 755 src/cats/create_mysql_database
 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
 chmod 755 src/cats/grant_mysql_privileges
 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables 
+chmod 755 src/cats/update_sqlite_tables
 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables 
+chmod 755 src/cats/update_mysql_tables
 chmod 755 src/cats/update_bacula_tables src/cats/update_mysql_tables
-chmod 755 src/cats/update/mysql_tables
 chmod 755 src/cats/create_sqlite_database
 chmod 755 src/cats/sqlite
 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables 
index 258c1663faedbfe77c25573e36b87411500d987c..7765f5ec8b9dc0ec919221877eea1f918f7e4a00 100755 (executable)
@@ -18940,9 +18940,10 @@ chmod 755 src/cats/create_mysql_database
 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
 chmod 755 src/cats/grant_mysql_privileges
 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
+chmod 755 src/cats/update_sqlite_tables
 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
+chmod 755 src/cats/update_mysql_tables
 chmod 755 src/cats/update_bacula_tables src/cats/update_mysql_tables
-chmod 755 src/cats/update/mysql_tables
 chmod 755 src/cats/create_sqlite_database
 chmod 755 src/cats/sqlite
 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
index 8aa46fd83c465d68215fb677583b382a5dee8516..c3f3736f247c22db5b3c59bbd9b82cfd885ce6fd 100644 (file)
@@ -56,9 +56,10 @@ For 1.33 Testing/Documentation:
 - Setup a standard job that builds a bootstrap file and saves
   it with the catalog database.
 - Document Dan's new --with-dir-user, ... options.
+- Document estimate command in tree.
+- Document lsmark command in tree.
                 
 For 1.33
-- Change "create_media_record in bscan to use Archive instead of Full.
 - Implement RestoreJobRetention? Maybe better "JobRetention" in a Job,
   which would take precidence over the Catalog "JobRetention".
 - Implement Label Format in Add and Label console commands.
@@ -78,7 +79,6 @@ After 1.33:
 - Create VolAddr for disk files in place of VolFile and VolBlock. This
   is needed to properly specify ranges.
 - Print bsmtp output to job report so that problems will be seen.
-- Have some way to estimate the restore size or have it printed.
 - Pass the number of files to be restored to the FD for reporting 
 - Add progress of files/bytes to SD and FD.
 - Don't continue Restore if no files selected.
@@ -87,9 +87,6 @@ After 1.33:
 - Add a date and time stamp at the beginning of every line in the 
   Job report (Volker Sauer).
 - Client does not show busy during Estimate command.
-- Volume problems occurs if you have valid volume, written, then it is
-  truncated. You get 12-Nov-2003 11:48 rufus-sd: kernsave.2003-11-12_11.48.09 Warning: mount.c:228 Volume on /tmp is not a Bacula labeled Volume, because:
-     block.c:640 Read zero bytes on device /tmp.
 - Implement Console mtx commands.
 - Look at 2Gb limit for SQLite.
 - Implement 3 Pools for a Job:
@@ -935,4 +932,9 @@ Done: (see kernsdone for more)
 - Make mark/unmark report how many files marked/unmarked.
 - Keep last 5 or 10 completed jobs and show them in a similar list.
 - Make a Running Jobs: output similar to current Scheduled Jobs:
+- Change "create_media_record in bscan to use Archive instead of Full.
+- Have some way to estimate the restore size or have it printed.
+- Volume problems occurs if you have valid volume, written, then it is
+  truncated. You get 12-Nov-2003 11:48 rufus-sd: kernsave.2003-11-12_11.48.09 Warning: mount.c:228 Volume on /tmp is not a Bacula labeled Volume, because:
+     block.c:640 Read zero bytes on device /tmp.
 
index 218f0b3c0f5430f15206d111f19187e04175098d..9c0b5f8166968a6f0086823e9e7b4b40198019bf 100644 (file)
@@ -135,8 +135,11 @@ CREATE TABLE Pool (
    MaxVolBytes BIGINT UNSIGNED NOT NULL,
    AutoPrune TINYINT DEFAULT 0,
    Recycle TINYINT DEFAULT 0,
-   PoolType ENUM('Backup', 'Copy', 'Cloned', 'Archive', 'Migration') NOT NULL,
+   PoolType ENUM('Backup', 'Copy', 'Cloned', 'Archive', 'Migration', 'Scratch') NOT NULL,
    LabelFormat TINYBLOB,
+   Enabled TINYINT DEFAULT 1,
+   ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
    UNIQUE (Name(128)),
    PRIMARY KEY (PoolId)
    );
index c948ee2ce1b5586723c30a112bea1c0ecedbcb5c..ed961d9a2afafb9fc98a3332f36a0026ef9b99ae 100644 (file)
@@ -139,6 +139,9 @@ CREATE TABLE Pool (
    Recycle TINYINT DEFAULT 0,
    PoolType VARCHAR(20) NOT NULL,
    LabelFormat VARCHAR(128) NOT NULL,
+   Enabled TINYINT DEFAULT 1,
+   ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
    UNIQUE (Name),
    PRIMARY KEY (PoolId)
    );
index 84bc5688609bdb622457f283881ffb1f9d2acf4e..9da912da9874e52fd7b35d9a5c5a6b813f8a7d02 100755 (executable)
@@ -14,6 +14,9 @@ USE bacula;
 ALTER TABLE Media ADD COLUMN Drive INTEGER NOT NULL DEFAULT 0;
 ALTER TABLE Media ADD COLUMN InChanger TINYINT NOT NULL DEFAULT 0;
 
+ALTER TABLE Pool ADD COLUMN Enabled TINYINT DEFAULT 1;
+ALTER TABLE Pool ADD COLUMN ScratchPoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool;
+ALTER TABLE Pool ADD COLUMN RecyclePoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool;
 
 DROP TABLE BaseFiles;
 
index ef75bc3e614ab71d27f797bc729390ebdc71eaf9..bb83b4f85cadd4ac664a5c680c9c28a56f11a116 100755 (executable)
@@ -49,7 +49,7 @@ INSERT INTO Media_backup SELECT
    VolMounts, VolBytes, VolErrors, VolWrites,
    VolCapacityBytes, VolStatus, Recycle,
    VolRetention, VolUseDuration, MaxVolJobs,
-   MaxVolFiles, MaxVolBytes
+   MaxVolFiles, MaxVolBytes, 0, 0
    FROM Media;
 
 
@@ -91,13 +91,104 @@ INSERT INTO Media (
    VolMounts, VolBytes, VolErrors, VolWrites,
    VolCapacityBytes, VolStatus, Recycle,
    VolRetention, VolUseDuration, MaxVolJobs,
-   MaxVolFiles, MaxVolBytes)
+   MaxVolFiles, MaxVolBytes, Drive, InChanger)
    SELECT * FROM Media_backup;
 
 DROP TABLE Media_backup;
 
 CREATE INDEX inx8 ON Media (PoolId);
 
+CREATE TABLE Pool_backup (
+   PoolId INTEGER UNSIGNED AUTOINCREMENT,
+   Name VARCHAR(128) NOT NULL,
+   NumVols INTEGER UNSIGNED DEFAULT 0,
+   MaxVols INTEGER UNSIGNED DEFAULT 0,
+   UseOnce TINYINT DEFAULT 0,
+   UseCatalog TINYINT DEFAULT 1,
+   AcceptAnyVolume TINYINT DEFAULT 0,
+   VolRetention BIGINT UNSIGNED DEFAULT 0,
+   VolUseDuration BIGINT UNSIGNED DEFAULT 0,
+   MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
+   MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
+   MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
+   AutoPrune TINYINT DEFAULT 0,
+   Recycle TINYINT DEFAULT 0,
+   PoolType VARCHAR(20) NOT NULL,
+   LabelFormat VARCHAR(128) NOT NULL,
+   Enabled TINYINT DEFAULT 1,
+   ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   UNIQUE (Name),
+   PRIMARY KEY (PoolId)
+   );
+
+INSERT INTO Pool_backup SELECT
+   PoolId,
+   Name,
+   NumVols,
+   MaxVols,
+   UseOnce,
+   UseCatalog,
+   AcceptAnyVolume,
+   VolRetention,
+   VolUseDuration,
+   MaxVolJobs,
+   MaxVolFiles,
+   MaxVolBytes,
+   AutoPrune,
+   Recycle,
+   PoolType,
+   LabelFormat, 1, 0, 0
+   FROM Pool;
+
+DROP TABLE Pool;
+
+CREATE TABLE Pool (
+   PoolId INTEGER UNSIGNED AUTOINCREMENT,
+   Name VARCHAR(128) NOT NULL,
+   NumVols INTEGER UNSIGNED DEFAULT 0,
+   MaxVols INTEGER UNSIGNED DEFAULT 0,
+   UseOnce TINYINT DEFAULT 0,
+   UseCatalog TINYINT DEFAULT 1,
+   AcceptAnyVolume TINYINT DEFAULT 0,
+   VolRetention BIGINT UNSIGNED DEFAULT 0,
+   VolUseDuration BIGINT UNSIGNED DEFAULT 0,
+   MaxVolJobs INTEGER UNSIGNED DEFAULT 0,
+   MaxVolFiles INTEGER UNSIGNED DEFAULT 0,
+   MaxVolBytes BIGINT UNSIGNED DEFAULT 0,
+   AutoPrune TINYINT DEFAULT 0,
+   Recycle TINYINT DEFAULT 0,
+   PoolType VARCHAR(20) NOT NULL,
+   LabelFormat VARCHAR(128) NOT NULL,
+   Enabled TINYINT DEFAULT 1,
+   ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
+   UNIQUE (Name),
+   PRIMARY KEY (PoolId)
+   );
+
+INSERT INTO Pool (
+   PoolId,
+   Name,
+   NumVols,
+   MaxVols,
+   UseOnce,
+   UseCatalog,
+   AcceptAnyVolume,
+   VolRetention,
+   VolUseDuration,
+   MaxVolJobs,
+   MaxVolFiles,
+   MaxVolBytes,
+   AutoPrune,
+   Recycle,
+   PoolType,
+   LabelFormat, Enabled, ScratchPoolId, RecyclePoolId)
+   SELECT * FROM Pool_backup;
+
+DROP TABLE Pool_backup;
+
+
 DROP TABLE BaseFiles;
 
 CREATE TABLE BaseFiles (
index 3d6b277fced221a50e4d0093a08ee0b9a1a8b21e..3afd8ce65a6aea34200738d73eb34a39d1535497 100644 (file)
@@ -49,6 +49,7 @@ Device {
 #  AutomaticMount = yes;               # when device opened, read it
 #  AlwaysOpen = yes;
 #  RemovableMedia = yes;
+#  RandomAccess = no;
 #}
 
 #
@@ -62,6 +63,7 @@ Device {
 #  AutomaticMount = yes;               # when device opened, read it
 #  AlwaysOpen = Yes;
 #  RemovableMedia = yes;
+#  RandomAccess = no;
 #}
 
 # 
index 198325246512954c05943788aadba82950261df7..d0d406c7a2582c4d230b636a2e8c854c91dc5344 100644 (file)
@@ -720,7 +720,8 @@ static int create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl)
    struct date_time dt;
    struct tm tm;
 
-   bstrncpy(mr->VolStatus, "Full", sizeof(mr->VolStatus));
+   /* We mark Vols as Archive to keep them from being re-written */
+   bstrncpy(mr->VolStatus, "Archive", sizeof(mr->VolStatus));
    mr->VolRetention = 365 * 3600 * 24; /* 1 year */
    if (vl->VerNum >= 11) {
       mr->FirstWritten = btime_to_utime(vl->write_btime);