mirror of
https://github.com/tomasriveral/NoteWrapper.git
synced 2026-08-11 18:18:36 +02:00
backup: fixed debugging
This commit is contained in:
+4
-4
@@ -202,9 +202,9 @@ void handleBackups(char **sourceDirectoryArray, const int sourceNumber, char **d
|
|||||||
if (endptr == line || (*endptr != '\n' && *endptr != '\0')) {
|
if (endptr == line || (*endptr != '\n' && *endptr != '\0')) {
|
||||||
error(1, "program", "Invalid timestamp in cache file: %s", line);
|
error(1, "program", "Invalid timestamp in cache file: %s", line);
|
||||||
}
|
}
|
||||||
|
double deltaTime = difftime(now, lastBackupTime);
|
||||||
if (difftime(now, lastBackupTime) > interval) {
|
if (deltaTime > interval) {
|
||||||
debug("(difftime) %d is greater than (interval) %d -> backuping...", difftime(now, lastBackupTime), interval);
|
debug("(difftime) %f is greater than (interval) %d -> backuping...", deltaTime, interval);
|
||||||
shouldBackup = 1;
|
shouldBackup = 1;
|
||||||
cacheFile = fopen(cacheFilePATH, "w");
|
cacheFile = fopen(cacheFilePATH, "w");
|
||||||
if (!cacheFile) {
|
if (!cacheFile) {
|
||||||
@@ -213,7 +213,7 @@ void handleBackups(char **sourceDirectoryArray, const int sourceNumber, char **d
|
|||||||
fprintf(cacheFile, "%ld\n", (long)now);
|
fprintf(cacheFile, "%ld\n", (long)now);
|
||||||
fclose(cacheFile);
|
fclose(cacheFile);
|
||||||
} else {
|
} else {
|
||||||
debug("(difftime) %d is smaller than (interval) %d -> no need to backup.", difftime(now, lastBackupTime), interval);
|
debug("(difftime) %f is smaller than (interval) %d -> no need to backup.", deltaTime, interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user