src/keep_backups.cpp
// Uses vfork() and execvp() to fork off a child process to copy the files to S3.
// Unfortunate that we have to hard code the location of aws (/usr/bin).
Uses vfork() and execvp() to fork off a child process to copy the files to S3.
Unfortunate that we have to hard code the location of aws (/usr/bin).
Uses vfork () and execvp () to fork off a child process to copy the files to S3 . Unfortunate that we have to hard code the location of aws ( / usr / bin ) .
static void Backup(void) {
  int pid = vfork();
  if (pid == 0) {
    char const *binary = "/usr/bin/aws";
    char const * newargv[] = { binary, "s3", "cp", kDir, "s3://slumbot2019cfr", "--recursive",
			       "--quiet", NULL };
    execvp(binary, (char * const *)newargv);
    fprintf(stderr, "Failed to execvp aws s3 cp process\n");
    exit(-1);
  }
  int return_status;
  waitpid(pid, &return_status, 0);
  if (return_status != 0) {
    fprintf(stderr, "aws s3 cp failed\n");
    exit(-1);
  }
}
static void Backup ( void ) { int pid = vfork ( ) ; if ( pid == 0 ) { char const * binary = " " ; char const * newargv [ ] = { binary , " " , " " , kDir , " " , " " , " " , NULL } ; execvp ( binary , ( char * const * ) newargv ) ; fprintf ( stderr , " \n " ) ; exit ( -1 ) ; } int return_status ; waitpid ( pid , & return_status , 0 ) ; if ( return_status != 0 ) { fprintf ( stderr , " \n " ) ; exit ( -1 ) ; } }
Uses vfork() and execvp() to fork off a child process to copy the files to S3.
Uses vfork () and execvp () to fork off a child process to copy the files to S3 .
// Child