Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Adding newlines, trailing -
Browse files Browse the repository at this point in the history
`aws s3 cp ... -`

if you want to pipe STDOUT into S3.
  • Loading branch information
jadudm committed Mar 4, 2024
1 parent 6771950 commit faeda59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/pipes/pg_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ func PG_Dump(creds *vcap.CredentialsRDS) *script.Pipe {
// Combine the slice for printing and execution.
combined := strings.Join(cmd[:], " ")
fmt.Printf("command: %s\n", combined)
logging.Logger.Printf("BACKUPS pg_dump targeting %s", creds.DB_Name)
logging.Logger.Printf("BACKUPS pg_dump targeting %s\n", creds.DB_Name)
return script.Exec(combined)
}
2 changes: 1 addition & 1 deletion internal/pipes/psql.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ func Psql(in_pipe *script.Pipe, creds *vcap.CredentialsRDS) *script.Pipe {
),
}
combined := strings.Join(cmd[:], " ")
logging.Logger.Printf("BACKUPS psql targeting %s", creds.DB_Name)
logging.Logger.Printf("BACKUPS psql targeting %s\n", creds.DB_Name)
return in_pipe.Exec(combined)
}
5 changes: 3 additions & 2 deletions internal/pipes/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ func S3(in_pipe *script.Pipe, up *vcap.CredentialsS3, prefix string, source_db s
up.Bucket,
prefix,
source_db),
"-",
}

// Combine the slice for printing and execution.
combined := strings.Join(cmd[:], " ")
fmt.Printf("command: %s", combined)
logging.Logger.Printf("BACKUPS s3 targeting %s", prefix)
fmt.Printf("command: %s\n", combined)
logging.Logger.Printf("BACKUPS s3 targeting %s\n", prefix)
return in_pipe.Exec(combined)
}

0 comments on commit faeda59

Please sign in to comment.