Added 1B, 2 and added bootstrap again for site
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const dataDir = path.resolve("data");
|
||||
const source = path.join(dataDir, "leistungsbilanz.db");
|
||||
|
||||
if (!fs.existsSync(source)) {
|
||||
console.error(`Database file not found: ${source}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const backupDir = path.join(dataDir, "backups");
|
||||
fs.mkdirSync(backupDir, { recursive: true });
|
||||
|
||||
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
||||
const target = path.join(backupDir, `leistungsbilanz-${timestamp}.db`);
|
||||
fs.copyFileSync(source, target);
|
||||
|
||||
console.log(`Backup created: ${target}`);
|
||||
Reference in New Issue
Block a user