General:
30Jun06
+- Fix a complier warning in files/backup.c
+- Cleanup NOT NULL vs DEFALT 0 in database creation.
+- Tweak btape.
- Robert committed his low impact changes.
- I removed a size_t from the jcr.h definition.
- Update the tape regression scripts (still to be tested).
using uint8_t * instead.
- Harden authentication failure in FD by single threading errors
and forcing a 6 second wait.
-- ========= Remove Accept Any Volume ========= directive.
+
+ ============= Warning ==================================
+ Removed "Accept Any Volume" directive.
+ ===========================================================
+
- Major cleanup and simplification of regress using shell functions
(more tests to be converted to new format)
- Add detection of 64 bit Irix as indicated by user.
bindir=@SQL_BINDIR@
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+$bindir/psql -f - -d bacula $* <<END-OF-DATA
drop table unsavedfiles;
drop table basefiles;
drop table jobmedia;
drop table MAC;
drop table Location;
END-OF-DATA
+pstat=$?
+if test $pstat = 0;
then
echo "Deletion of Bacula PostgreSQL tables succeeded."
else
echo "Deletion of Bacula PostgreSQL tables failed."
fi
-exit 0
+exit $pstat
CREATE TABLE File (
FileId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
- FileIndex INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ FileIndex INTEGER UNSIGNED DEFAULT 0,
JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
PathId INTEGER UNSIGNED NOT NULL REFERENCES Path,
FilenameId INTEGER UNSIGNED NOT NULL REFERENCES Filename,
- MarkId INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ MarkId INTEGER UNSIGNED DEFAULT 0,
LStat TINYBLOB NOT NULL,
- MD5 TINYBLOB NOT NULL,
+ MD5 TINYBLOB,
PRIMARY KEY(FileId),
INDEX (JobId),
INDEX (JobId, PathId, FilenameId)
CREATE TABLE Device (
DeviceId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Name TINYBLOB NOT NULL,
- MediaTypeId INTEGER UNSIGNED NOT NULL REFERENCES MediaType,
- StorageId INTEGER UNSIGNED NOT NULL REFERENCES Storage,
+ MediaTypeId INTEGER UNSIGNED DEFAULT 0 REFERENCES MediaType,
+ StorageId INTEGER UNSIGNED DEFAULT 0 REFERENCES Storage,
DevMounts INTEGER UNSIGNED DEFAULT 0,
DevReadBytes BIGINT UNSIGNED DEFAULT 0,
DevWriteBytes BIGINT UNSIGNED DEFAULT 0,
Name TINYBLOB NOT NULL,
Type BINARY(1) NOT NULL,
Level BINARY(1) NOT NULL,
- ClientId INTEGER NOT NULL DEFAULT 0 REFERENCES Client,
+ ClientId INTEGER DEFAULT 0 REFERENCES Client,
JobStatus BINARY(1) NOT NULL,
- SchedTime DATETIME NOT NULL,
- StartTime DATETIME NOT NULL DEFAULT 0,
- EndTime DATETIME NOT NULL DEFAULT 0,
- RealEndTime DATETIME NOT NULL DEFAULT 0,
- JobTDate BIGINT UNSIGNED NOT NULL,
- VolSessionId INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolSessionTime INTEGER UNSIGNED NOT NULL DEFAULT 0,
- JobFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
- JobBytes BIGINT UNSIGNED NOT NULL DEFAULT 0,
- JobErrors INTEGER UNSIGNED NOT NULL DEFAULT 0,
- JobMissingFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
- PoolId INTEGER UNSIGNED NOT NULL DEFAULT 0 REFERENCES Pool,
- FileSetId INTEGER UNSIGNED NOT NULL DEFAULT 0 REFERENCES FileSet,
+ SchedTime DATETIME DEFAULT 0,
+ StartTime DATETIME DEFAULT 0,
+ EndTime DATETIME DEFAULT 0,
+ RealEndTime DATETIME DEFAULT 0,
+ JobTDate BIGINT UNSIGNED DEFAULT 0,
+ VolSessionId INTEGER UNSIGNED DEFAULT 0,
+ VolSessionTime INTEGER UNSIGNED DEFAULT 0,
+ JobFiles INTEGER UNSIGNED DEFAULT 0,
+ JobBytes BIGINT UNSIGNED DEFAULT 0,
+ JobErrors INTEGER UNSIGNED DEFAULT 0,
+ JobMissingFiles INTEGER UNSIGNED DEFAULT 0,
+ PoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool,
+ FileSetId INTEGER UNSIGNED DEFAULT 0 REFERENCES FileSet,
PriorJobId INTEGER UNSIGNED DEFAULT 0 REFERENCES Job,
- PurgedFiles TINYINT NOT NULL DEFAULT 0,
- HasBase TINYINT NOT NULL DEFAULT 0,
+ PurgedFiles TINYINT DEFAULT 0,
+ HasBase TINYINT DEFAULT 0,
PRIMARY KEY(JobId),
INDEX (Name(128))
);
CREATE TABLE Location (
LocationId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Location TINYBLOB NOT NULL,
- Cost INTEGER NOT NULL DEFAULT 0,
+ Cost INTEGER DEFAULT 0,
PRIMARY KEY(LocationId)
);
CREATE TABLE FileSet (
FileSetId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
FileSet TINYBLOB NOT NULL,
- MD5 TINYBLOB NOT NULL,
- CreateTime DATETIME NOT NULL,
+ MD5 TINYBLOB,
+ CreateTime DATETIME DEFAULT 0,
PRIMARY KEY(FileSetId)
);
JobMediaId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
MediaId INTEGER UNSIGNED NOT NULL REFERENCES Media,
- FirstIndex INTEGER UNSIGNED NOT NULL DEFAULT 0,
- LastIndex INTEGER UNSIGNED NOT NULL DEFAULT 0,
- StartFile INTEGER UNSIGNED NOT NULL DEFAULT 0,
- EndFile INTEGER UNSIGNED NOT NULL DEFAULT 0,
- StartBlock INTEGER UNSIGNED NOT NULL DEFAULT 0,
- EndBlock INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolIndex INTEGER UNSIGNED NOT NULL DEFAULT 0,
- Copy INTEGER UNSIGNED NOT NULL DEFAULT 0,
- Stripe INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ FirstIndex INTEGER UNSIGNED DEFAULT 0,
+ LastIndex INTEGER UNSIGNED DEFAULT 0,
+ StartFile INTEGER UNSIGNED DEFAULT 0,
+ EndFile INTEGER UNSIGNED DEFAULT 0,
+ StartBlock INTEGER UNSIGNED DEFAULT 0,
+ EndBlock INTEGER UNSIGNED DEFAULT 0,
+ VolIndex INTEGER UNSIGNED DEFAULT 0,
+ Copy INTEGER UNSIGNED DEFAULT 0,
+ Stripe INTEGER UNSIGNED DEFAULT 0,
PRIMARY KEY(JobMediaId),
INDEX (JobId, MediaId)
);
CREATE TABLE Media (
MediaId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
VolumeName TINYBLOB NOT NULL,
- Slot INTEGER NOT NULL DEFAULT 0,
- PoolId INTEGER UNSIGNED NOT NULL REFERENCES Pool,
+ Slot INTEGER DEFAULT 0,
+ PoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool,
MediaType TINYBLOB NOT NULL,
- MediaTypeId INTEGER UNSIGNED NOT NULL REFERENCES MediaType,
- LabelType TINYINT NOT NULL DEFAULT 0,
- FirstWritten DATETIME NOT NULL DEFAULT 0,
- LastWritten DATETIME NOT NULL DEFAULT 0,
- LabelDate DATETIME NOT NULL DEFAULT 0,
- VolJobs INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolBlocks INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolMounts INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolBytes BIGINT UNSIGNED NOT NULL DEFAULT 0,
- VolParts INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolErrors INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolWrites INTEGER UNSIGNED NOT NULL DEFAULT 0,
- VolCapacityBytes BIGINT UNSIGNED NOT NULL,
+ MediaTypeId INTEGER UNSIGNED DEFAULT 0 REFERENCES MediaType,
+ LabelType TINYINT DEFAULT 0,
+ FirstWritten DATETIME DEFAULT 0,
+ LastWritten DATETIME DEFAULT 0,
+ LabelDate DATETIME DEFAULT 0,
+ VolJobs INTEGER UNSIGNED DEFAULT 0,
+ VolFiles INTEGER UNSIGNED DEFAULT 0,
+ VolBlocks INTEGER UNSIGNED DEFAULT 0,
+ VolMounts INTEGER UNSIGNED DEFAULT 0,
+ VolBytes BIGINT UNSIGNED DEFAULT 0,
+ VolParts INTEGER UNSIGNED DEFAULT 0,
+ VolErrors INTEGER UNSIGNED DEFAULT 0,
+ VolWrites INTEGER UNSIGNED DEFAULT 0,
+ VolCapacityBytes BIGINT UNSIGNED DEFAULT 0,
VolStatus ENUM('Full', 'Archive', 'Append', 'Recycle', 'Purged',
'Read-Only', 'Disabled', 'Error', 'Busy', 'Used', 'Cleaning') NOT NULL,
Enabled TINYINT DEFAULT 1,
- Recycle TINYINT NOT NULL DEFAULT 0,
- VolRetention BIGINT UNSIGNED NOT NULL DEFAULT 0,
- VolUseDuration BIGINT UNSIGNED NOT NULL DEFAULT 0,
- MaxVolJobs INTEGER UNSIGNED NOT NULL DEFAULT 0,
- MaxVolFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
- MaxVolBytes BIGINT UNSIGNED NOT NULL DEFAULT 0,
- InChanger TINYINT NOT NULL DEFAULT 0,
+ Recycle 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,
+ InChanger TINYINT DEFAULT 0,
StorageId INTEGER UNSIGNED DEFAULT 0 REFERENCES Storage,
DeviceId INTEGER UNSIGNED DEFAULT 0 REFERENCES Device,
- MediaAddressing TINYINT NOT NULL DEFAULT 0,
- VolReadTime BIGINT UNSIGNED NOT NULL DEFAULT 0,
- VolWriteTime BIGINT UNSIGNED NOT NULL DEFAULT 0,
- EndFile INTEGER UNSIGNED NOT NULL DEFAULT 0,
- EndBlock INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ MediaAddressing TINYINT DEFAULT 0,
+ VolReadTime BIGINT UNSIGNED DEFAULT 0,
+ VolWriteTime BIGINT UNSIGNED DEFAULT 0,
+ EndFile INTEGER UNSIGNED DEFAULT 0,
+ EndBlock INTEGER UNSIGNED DEFAULT 0,
LocationId INTEGER UNSIGNED DEFAULT 0 REFERENCES Location,
RecycleCount INTEGER UNSIGNED DEFAULT 0,
- InitialWrite DATETIME NOT NULL DEFAULT 0,
+ InitialWrite DATETIME DEFAULT 0,
ScratchPoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool,
RecyclePoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool,
PRIMARY KEY(MediaId),
CREATE TABLE Pool (
PoolId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Name TINYBLOB NOT NULL,
- NumVols INTEGER UNSIGNED NOT NULL DEFAULT 0,
- MaxVols INTEGER UNSIGNED NOT NULL DEFAULT 0,
- UseOnce TINYINT NOT NULL,
- UseCatalog TINYINT NOT NULL,
+ NumVols INTEGER UNSIGNED DEFAULT 0,
+ MaxVols INTEGER UNSIGNED DEFAULT 0,
+ UseOnce TINYINT DEFAULT 0,
+ UseCatalog TINYINT DEFAULT 0,
AcceptAnyVolume TINYINT DEFAULT 0,
- VolRetention BIGINT UNSIGNED NOT NULL,
- VolUseDuration BIGINT UNSIGNED NOT NULL,
- MaxVolJobs INTEGER UNSIGNED NOT NULL DEFAULT 0,
- MaxVolFiles INTEGER UNSIGNED NOT NULL DEFAULT 0,
- MaxVolBytes BIGINT UNSIGNED NOT NULL,
+ 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 ENUM('Backup', 'Copy', 'Cloned', 'Archive', 'Migration', 'Scratch') NOT NULL,
- LabelType TINYINT NOT NULL DEFAULT 0,
+ LabelType TINYINT DEFAULT 0,
LabelFormat TINYBLOB,
Enabled TINYINT DEFAULT 1,
ScratchPoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool,
Name TINYBLOB NOT NULL,
Uname TINYBLOB NOT NULL, /* full uname -a of client */
AutoPrune TINYINT DEFAULT 0,
- FileRetention BIGINT UNSIGNED NOT NULL,
- JobRetention BIGINT UNSIGNED NOT NULL,
+ FileRetention BIGINT UNSIGNED DEFAULT 0,
+ JobRetention BIGINT UNSIGNED DEFAULT 0,
UNIQUE (Name(128)),
PRIMARY KEY(ClientId)
);
CREATE TABLE Counters (
Counter TINYBLOB NOT NULL,
- MinValue INTEGER,
- MaxValue INTEGER,
- CurrentValue INTEGER,
+ MinValue INTEGER DEFAULT 0,
+ MaxValue INTEGER DEFAULT 0,
+ CurrentValue INTEGER DEFAULT 0,
WrapCounter TINYBLOB NOT NULL,
PRIMARY KEY (Counter(128))
);
#
bindir=@SQL_BINDIR@
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+$bindir/psql -f - -d bacula $* <<END-OF-DATA
CREATE TABLE filename
(
name text not null,
type char(1) not null,
level char(1) not null,
- clientid integer,
+ clientid integer default 0,
jobstatus char(1) not null,
- schedtime timestamp without time zone not null,
+ schedtime timestamp without time zone,
starttime timestamp without time zone,
endtime timestamp without time zone,
realendtime timestamp without time zone,
- jobtdate bigint not null,
- volsessionid integer not null default 0,
- volsessiontime integer not null default 0,
- jobfiles integer not null default 0,
- jobbytes bigint not null default 0,
- joberrors integer not null default 0,
- jobmissingfiles integer not null default 0,
- poolid integer,
- filesetid integer,
- purgedfiles smallint not null default 0,
- hasbase smallint not null default 0,
- priorjobid integer not null default 0,
+ jobtdate bigint default 0,
+ volsessionid integer default 0,
+ volsessiontime integer default 0,
+ jobfiles integer default 0,
+ jobbytes bigint default 0,
+ joberrors integer default 0,
+ jobmissingfiles integer default 0,
+ poolid integer default 0,
+ filesetid integer default 0,
+ purgedfiles smallint default 0,
+ hasbase smallint default 0,
+ priorjobid integer default 0,
primary key (jobid)
);
CREATE TABLE Location (
LocationId serial not null,
Location text not null,
- Cost integer not null default 0,
+ Cost integer default 0,
primary key (LocationId)
);
jobmediaid serial not null,
jobid integer not null,
mediaid integer not null,
- firstindex integer not null default 0,
- lastindex integer not null default 0,
- startfile integer not null default 0,
- endfile integer not null default 0,
- startblock bigint not null default 0,
- endblock bigint not null default 0,
- volindex integer not null default 0,
- copy integer not null default 0,
+ firstindex integer default 0,
+ lastindex integer default 0,
+ startfile integer default 0,
+ endfile integer default 0,
+ startblock bigint default 0,
+ endblock bigint default 0,
+ volindex integer default 0,
+ copy integer default 0,
primary key (jobmediaid)
);
(
mediaid serial not null,
volumename text not null,
- slot integer not null default 0,
- poolid integer not null,
+ slot integer default 0,
+ poolid integer default 0,
mediatype text not null,
- mediatypeid integer not null,
- labeltype integer not null default 0,
+ mediatypeid integer default 0,
+ labeltype integer default 0,
firstwritten timestamp without time zone,
lastwritten timestamp without time zone,
labeldate timestamp without time zone,
- voljobs integer not null default 0,
- volfiles integer not null default 0,
- volblocks integer not null default 0,
- volmounts integer not null default 0,
- volbytes bigint not null default 0,
- volparts integer not null default 0,
- volerrors integer not null default 0,
- volwrites integer not null default 0,
- volcapacitybytes bigint not null default 0,
+ voljobs integer default 0,
+ volfiles integer default 0,
+ volblocks integer default 0,
+ volmounts integer default 0,
+ volbytes bigint default 0,
+ volparts integer default 0,
+ volerrors integer default 0,
+ volwrites integer default 0,
+ volcapacitybytes bigint default 0,
volstatus text not null
check (volstatus in ('Full','Archive','Append',
'Recycle','Purged','Read-Only','Disabled',
'Error','Busy','Used','Cleaning','Scratch')),
- enabled smallint not null default 1,
- recycle smallint not null default 0,
- volretention bigint not null default 0,
- voluseduration bigint not null default 0,
- maxvoljobs integer not null default 0,
- maxvolfiles integer not null default 0,
- maxvolbytes bigint not null default 0,
- inchanger smallint not null default 0,
- StorageId integer default 0,
- DeviceId integer default 0,
- mediaaddressing smallint not null default 0,
- volreadtime bigint not null default 0,
- volwritetime bigint not null default 0,
- endfile integer not null default 0,
- endblock bigint not null default 0,
- LocationId integer default 0,
- recyclecount integer not null default 0,
+ enabled smallint default 1,
+ recycle smallint default 0,
+ volretention bigint default 0,
+ voluseduration bigint default 0,
+ maxvoljobs integer default 0,
+ maxvolfiles integer default 0,
+ maxvolbytes bigint default 0,
+ inchanger smallint default 0,
+ StorageId integer default 0,
+ DeviceId integer default 0,
+ mediaaddressing smallint default 0,
+ volreadtime bigint default 0,
+ volwritetime bigint default 0,
+ endfile integer default 0,
+ endblock bigint default 0,
+ LocationId integer default 0,
+ recyclecount integer default 0,
initialwrite timestamp without time zone,
- scratchpoolid integer default 0,
- recyclepoolid integer default 0,
+ scratchpoolid integer default 0,
+ recyclepoolid integer default 0,
primary key (mediaid)
);
DevWriteTime BIGINT NOT NULL DEFAULT 0,
DevReadTimeSinceCleaning BIGINT NOT NULL DEFAULT 0,
DevWriteTimeSinceCleaning BIGINT NOT NULL DEFAULT 0,
- CleaningDate TIMESTAMP WITHOUT TIME ZONE,
+ CleaningDate timestamp without time zone,
CleaningPeriod BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY(DeviceId)
);
(
poolid serial not null,
name text not null,
- numvols integer not null default 0,
- maxvols integer not null default 0,
- useonce smallint not null default 0,
- usecatalog smallint not null default 0,
- acceptanyvolume smallint not null default 0,
- volretention bigint not null default 0,
- voluseduration bigint not null default 0,
- maxvoljobs integer not null default 0,
- maxvolfiles integer not null default 0,
- maxvolbytes bigint not null default 0,
- autoprune smallint not null default 0,
- recycle smallint not null default 0,
+ numvols integer default 0,
+ maxvols integer default 0,
+ useonce smallint default 0,
+ usecatalog smallint default 0,
+ acceptanyvolume smallint default 0,
+ volretention bigint default 0,
+ voluseduration bigint default 0,
+ maxvoljobs integer default 0,
+ maxvolfiles integer default 0,
+ maxvolbytes bigint default 0,
+ autoprune smallint default 0,
+ recycle smallint default 0,
pooltype text
check (pooltype in ('Backup','Copy','Cloned','Archive','Migration','Scratch')),
- labeltype integer not null default 0,
+ labeltype integer default 0,
labelformat text not null,
- enabled smallint not null default 1,
- scratchpoolid integer default 0,
- recyclepoolid integer default 0,
- NextPoolId integer default 0,
- MigrationHighBytes BIGINT DEFAULT 0,
- MigrationLowBytes BIGINT DEFAULT 0,
- MigrationTime BIGINT DEFAULT 0,
+ enabled smallint default 1,
+ scratchpoolid integer default 0,
+ recyclepoolid integer default 0,
+ NextPoolId integer default 0,
+ MigrationHighBytes BIGINT DEFAULT 0,
+ MigrationLowBytes BIGINT DEFAULT 0,
+ MigrationTime BIGINT DEFAULT 0,
primary key (poolid)
);
name text not null,
uname text not null,
autoprune smallint default 0,
- fileretention bigint not null,
- jobretention bigint not null,
+ fileretention bigint default 0,
+ jobretention bigint default 0,
primary key (clientid)
);
CREATE TABLE counters
(
counter text not null,
- minvalue integer,
- maxvalue integer,
- currentvalue integer,
+ minvalue integer default 0,
+ maxvalue integer default 0,
+ currentvalue integer default 0,
wrapcounter text not null,
primary key (counter)
);
END-OF-DATA
+pstat=$?
+if test $pstat = 0;
then
echo "Creation of Bacula PostgreSQL tables succeeded."
else
echo "Creation of Bacula PostgreSQL tables failed."
fi
-exit 0
+exit $pstat
MediaId INTEGER,
VolumeName VARCHAR(128) NOT NULL,
Slot INTEGER DEFAULT 0,
- PoolId INTEGER UNSIGNED REFERENCES Pool NOT NULL,
+ PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
MediaType VARCHAR(128) NOT NULL,
MediaTypeId INTEGER UNSIGNED REFERENCES MediaType DEFAULT 0,
LabelType TINYINT DEFAULT 0,
MediaId INTEGER,
VolumeName VARCHAR(128) NOT NULL,
Slot INTEGER DEFAULT 0,
- PoolId INTEGER UNSIGNED REFERENCES Pool NOT NULL,
+ PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
MediaType VARCHAR(128) NOT NULL,
MediaTypeId INTEGER UNSIGNED REFERENCES MediaType DEFAULT 0,
LabelType TINYINT DEFAULT 0,
Dmsg1(300, "bfiled>stored:header %s\n", sd->msg);
/* Grow the bsock buffer to fit our message if necessary */
- if (sizeof_pool_memory(sd->msg) < size) {
+ if (sizeof_pool_memory(sd->msg) < (int32_t)size) {
sd->msg = realloc_pool_memory(sd->msg, size);
}
static int argc;
static int quickie_count = 0;
+static uint64_t write_count = 0;
static BSR *bsr = NULL;
static int signals = TRUE;
static bool ok;
/* Get out after writing 10 blocks to the second tape */
if (BlockNumber > 10 && stop != 0) { /* get out */
- Pmsg0(-1, "Done writing ...\n");
+ char ed1[50];
+ Pmsg1(-1, "Done writing %s records ...\n",
+ edit_uint64_with_commas(write_count, ed1));
break;
}
}
dev->close();
get_cmd(_("Mount first tape. Press enter when ready: "));
}
- free_restore_volume_list(jcr);
- jcr->dcr = new_dcr(jcr, dev);
- set_volume_name("TestVolume1", 1);
- jcr->bsr = NULL;
- create_restore_volume_list(jcr);
- dev->close();
- dev->num_writers = 0;
- if (!acquire_device_for_read(dcr)) {
- Pmsg1(-1, "%s", dev->errmsg);
- goto bail_out;
- }
+ }
+
+ free_restore_volume_list(jcr);
+ jcr->dcr = new_dcr(jcr, dev);
+ set_volume_name("TestVolume1", 1);
+ jcr->bsr = NULL;
+ create_restore_volume_list(jcr);
+ dev->close();
+ dev->num_writers = 0;
+ if (!acquire_device_for_read(dcr)) {
+ Pmsg1(-1, "%s", dev->errmsg);
+ goto bail_out;
}
/*
* We now have the first tape mounted.
DEV_BLOCK *block = dcr->block;
Dmsg0(20, "Enter my_mount_next_read_volume\n");
- Pmsg1(000, _("End of Volume \"%s\"\n"), dcr->VolumeName);
+ Pmsg2(000, _("End of Volume \"%s\" %d records.\n"), dcr->VolumeName,
+ quickie_count);
if (LastBlock != block->BlockNumber) {
VolBytes += block->block_len;