Skip to content

Build your personal knowledge base with Trilium Notes

use mtime instead of ctime for backups #4321

zadam5163e50e7d22
diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js
index c8a07b8585..42b5e15ede 100644
--- a/src/public/app/widgets/type_widgets/options/backup.js
+++ b/src/public/app/widgets/type_widgets/options/backup.js
@@ -84,11 +84,11 @@ export default class BackupOptions extends OptionsWidget {
this.$existingBackupList.empty();
if (!backupFiles.length) {
- backupFiles = [{filePath: "no backup yet", ctime: ''}];
+ backupFiles = [{filePath: "no backup yet", mtime: ''}];
}
- for (const {filePath, ctime} of backupFiles) {
- this.$existingBackupList.append($("<li>").text(`${filePath} ${ctime ? ` - ${ctime}` : ''}`));
+ for (const {filePath, mtime} of backupFiles) {
+ this.$existingBackupList.append($("<li>").text(`${filePath} ${mtime ? ` - ${mtime}` : ''}`));
}
});
}
diff --git a/src/services/backup.js b/src/services/backup.js
index 29fbbd0a40..7fa41eb5e5 100644
--- a/src/services/backup.js
+++ b/src/services/backup.js
@@ -21,7 +21,7 @@ function getExistingBackups() {
const filePath = path.resolve(dataDir.BACKUP_DIR, fileName);
const stat = fs.statSync(filePath)
- return {fileName, filePath, ctime: stat.ctime};
+ return {fileName, filePath, mtime: stat.mtime};
});
}