Skip to content

Commit

Permalink
Capture the start time earlier.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Aug 25, 2023
1 parent 81ed5be commit d2e7fc0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/backup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ RecurseOption Backup::addTarEntry(Path *abspath, FileStat *st)
if(S_ISSOCK(st->st_mode)) { return RecurseContinue; }
#endif

if (isInTheFuture(&st->st_mtim)) {
warning(BACKUP, "Found future dated file %s\n", path->c_str());
found_future_dated_file_ = true;
}

// Ignore any directory that has a subdir named .beak
if(S_ISDIR(st->st_mode) && abspath->depth() > root_dir_path->depth())
{
Expand All @@ -98,6 +93,12 @@ RecurseOption Backup::addTarEntry(Path *abspath, FileStat *st)
// the configured beak source dir that we are scanning.
if (abspath->name()->str() == ".beak") return RecurseSkipSubTree;

// Check if the files is in the future....
if (isInTheFuture(&st->st_mtim)) {
warning(BACKUP, "Found future dated file >%s<\n", abspath->c_str());
found_future_dated_file_ = true;
}

size_t len = strlen(path->c_str());
char name[len+2];
strcpy(name, path->c_str());
Expand Down
1 change: 0 additions & 1 deletion src/beak.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ void findAndSetLogging(int argc, char **argv);

struct Beak
{
virtual void captureStartTime() = 0;
virtual Command parseCommandLine(int argc, char **argv, Settings *settings) = 0;

virtual RC store(Settings *settings, Monitor *monitor) = 0;
Expand Down
1 change: 0 additions & 1 deletion src/beak_implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ struct BeakImplementation : Beak
void printCommands(bool verbose, bool has_media);
void printSettings(bool verbose, Command cmd, bool has_media);

void captureStartTime() { ::captureStartTime(); }
Command parseCommandLine(int argc, char **argv, Settings *settings);

void printHelp(bool verbose, Command cmd, bool has_media);
Expand Down
4 changes: 2 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ int run(int argc, char *argv[])

setStackSize();

::captureStartTime();

// First create the OS interface to invoke external commands like rclone and rsync.
auto sys = newSystem();
// Next create the interface to the local file system where we find:
Expand All @@ -102,8 +104,6 @@ int run(int argc, char *argv[])
// Now create the beak backup software.
auto beak = newBeak(configuration, sys, local_fs, storage_tool, origin_tool);

beak->captureStartTime();

// Configure the settings by parsing the command line and extract the command.
Settings settings;
Command cmd = beak->parseCommandLine(argc, argv, &settings);
Expand Down

0 comments on commit d2e7fc0

Please sign in to comment.