mirror of https://github.com/vitalif/zbackup
parent
78dc42fd96
commit
d6cb627fad
|
@ -27,9 +27,15 @@ void BundleCollector::finishIndex( string const & indexFn )
|
|||
{
|
||||
if ( indexModified )
|
||||
{
|
||||
verbosePrintf( "Chunks: %d used / %d total, bundles: %d kept / %d modified / %d removed\n",
|
||||
indexUsedChunks, indexTotalChunks, indexKeptBundles, indexModifiedBundles, indexRemovedBundles);
|
||||
verbosePrintf( "Chunks used: %d/%d, bundles: %d kept, %d modified, %d removed\n",
|
||||
indexUsedChunks, indexTotalChunks, indexKeptBundles,
|
||||
indexModifiedBundles, indexRemovedBundles);
|
||||
filesToUnlink.push_back( indexFn );
|
||||
commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
chunkStorageWriter->reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,16 +62,14 @@ void BundleCollector::finishBundle( Bundle::Id const & bundleId, BundleInfo cons
|
|||
indexUsedChunks += usedChunks;
|
||||
if ( usedChunks == 0 )
|
||||
{
|
||||
if ( verbose )
|
||||
printf( "delete %s\n", i.c_str() );
|
||||
verbosePrintf( "Deleting %s bundle\n", i.c_str() );
|
||||
filesToUnlink.push_back( Dir::addPath( bundlesPath, i ) );
|
||||
indexModified = true;
|
||||
indexRemovedBundles++;
|
||||
}
|
||||
else if ( usedChunks < totalChunks )
|
||||
{
|
||||
if ( verbose )
|
||||
printf( "%s: used %d/%d\n", i.c_str(), usedChunks, totalChunks );
|
||||
verbosePrintf( "%s: used %d/%d chunks\n", i.c_str(), usedChunks, totalChunks );
|
||||
filesToUnlink.push_back( Dir::addPath( bundlesPath, i ) );
|
||||
indexModified = true;
|
||||
// Copy used chunks to the new index
|
||||
|
@ -86,8 +90,7 @@ void BundleCollector::finishBundle( Bundle::Id const & bundleId, BundleInfo cons
|
|||
else
|
||||
{
|
||||
chunkStorageWriter->addBundle( info, savedId );
|
||||
if ( verbose )
|
||||
printf( "keep %s\n", i.c_str() );
|
||||
verbosePrintf( "Keeping %s bundle\n", i.c_str() );
|
||||
indexKeptBundles++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ private:
|
|||
|
||||
public:
|
||||
string bundlesPath;
|
||||
bool verbose;
|
||||
ChunkStorage::Reader *chunkStorageReader;
|
||||
ChunkStorage::Writer *chunkStorageWriter;
|
||||
BackupRestorer::ChunkSet usedChunkSet;
|
||||
|
|
Loading…
Reference in New Issue