From faeda59fbd21b2b1d44226cc77aaf7fc9ac05432 Mon Sep 17 00:00:00 2001 From: Matt Jadud Date: Mon, 4 Mar 2024 17:01:50 -0500 Subject: [PATCH] Adding newlines, trailing - `aws s3 cp ... -` if you want to pipe STDOUT into S3. --- internal/pipes/pg_dump.go | 2 +- internal/pipes/psql.go | 2 +- internal/pipes/s3.go | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/pipes/pg_dump.go b/internal/pipes/pg_dump.go index 612bb60..4d5386a 100644 --- a/internal/pipes/pg_dump.go +++ b/internal/pipes/pg_dump.go @@ -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) } diff --git a/internal/pipes/psql.go b/internal/pipes/psql.go index c5c7e45..dedad73 100644 --- a/internal/pipes/psql.go +++ b/internal/pipes/psql.go @@ -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) } diff --git a/internal/pipes/s3.go b/internal/pipes/s3.go index 25e997d..b71de06 100644 --- a/internal/pipes/s3.go +++ b/internal/pipes/s3.go @@ -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) }