backup target: create snapshot and cache files per target

snapshot file tracks the snapshot directory. when app gets deleted,
the cleaner will remove the upstream snapshot directory when it runs.

cache files are used in rsync logic to track what was uploading into
snapshot in the previous run without needing to rescan upstream.
This commit is contained in:
Girish Ramakrishnan
2025-07-30 11:19:07 +02:00
parent b971f2ab22
commit ae3a34287a
9 changed files with 87 additions and 71 deletions

View File

@@ -16,7 +16,7 @@ const createTree = require('./common.js').createTree,
syncer = require('../syncer.js');
const gTmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'syncer-test')),
gCacheFile = path.join(paths.BACKUP_INFO_DIR, path.basename(gTmpDir) + '.sync.cache');
gCacheFile = path.join(paths.BACKUP_INFO_DIR, 'syncer-test.sync.cache');
describe('Syncer', function () {
before(function () {
@@ -24,7 +24,7 @@ describe('Syncer', function () {
});
async function getChanges(dataLayout) {
const changes = await syncer.sync(dataLayout);
const changes = await syncer.sync(dataLayout, { cacheFile: gCacheFile });
syncer.finalize(changes);
return changes.delQueue.concat(changes.addQueue);
}