A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/1edbf9e7852667d0e480141981ae3a8ca5ddb721 below:

Add the --delete-uploaded to delete local file after upload · orgrim/pg_back@1edbf9e · GitHub

@@ -82,19 +82,20 @@ type options struct {

82 82

WithRolePasswords bool

83 83

DumpOnly bool

84 84 85 -

Upload string // values are none, b2, s3, sftp, gcs

86 -

UploadPrefix string

87 -

Download string // values are none, b2, s3, sftp, gcs

88 -

ListRemote string // values are none, b2, s3, sftp, gcs

89 -

PurgeRemote bool

90 -

S3Region string

91 -

S3Bucket string

92 -

S3EndPoint string

93 -

S3Profile string

94 -

S3KeyID string

95 -

S3Secret string

96 -

S3ForcePath bool

97 -

S3DisableTLS bool

85 +

Upload string // values are none, b2, s3, sftp, gcs

86 +

UploadPrefix string

87 +

DeleteUploaded bool

88 +

Download string // values are none, b2, s3, sftp, gcs

89 +

ListRemote string // values are none, b2, s3, sftp, gcs

90 +

PurgeRemote bool

91 +

S3Region string

92 +

S3Bucket string

93 +

S3EndPoint string

94 +

S3Profile string

95 +

S3KeyID string

96 +

S3Secret string

97 +

S3ForcePath bool

98 +

S3DisableTLS bool

98 99 99 100

B2Bucket string

100 101

B2KeyID string

@@ -297,6 +298,7 @@ func parseCli(args []string) (options, []string, error) {

297 298 298 299

pflag.StringVar(&opts.Upload, "upload", "none", "upload produced files to target (s3, gcs,..) use \"none\" to override\nconfiguration file and disable upload")

299 300

pflag.StringVar(&opts.UploadPrefix, "upload-prefix", "", "add this prefix to uploaded files, similar to a target directory")

301 +

deleteUploaded := pflag.String("delete-uploaded", "no", "delete local file after upload")

300 302

pflag.StringVar(&opts.Download, "download", "none", "download files from target (s3, gcs,..) instead of dumping. DBNAMEs become\nglobs to select files")

301 303

pflag.StringVar(&opts.ListRemote, "list-remote", "none", "list the remote files on s3, gcs, sftp, azure instead of dumping. DBNAMEs become\nglobs to select files")

302 304

purgeRemote := pflag.String("purge-remote", "no", "purge the file on remote location after upload, with the same rules\nas the local directory")

@@ -473,6 +475,11 @@ func parseCli(args []string) (options, []string, error) {

473 475

return opts, changed, fmt.Errorf("invalid value for --list-remote: %s", err)

474 476

}

475 477 478 +

opts.DeleteUploaded, err = validateYesNoOption(*deleteUploaded)

479 +

if err != nil {

480 +

return opts, changed, fmt.Errorf("invalid value for --delete-uploaded: %s", err)

481 +

}

482 + 476 483

opts.PurgeRemote, err = validateYesNoOption(*purgeRemote)

477 484

if err != nil {

478 485

return opts, changed, fmt.Errorf("invalid value for --purge-remote: %s", err)

@@ -532,7 +539,7 @@ func validateConfigurationFile(cfg *ini.File) error {

532 539

"sftp_port", "sftp_user", "sftp_password", "sftp_directory", "sftp_identity",

533 540

"sftp_ignore_hostkey", "gcs_bucket", "gcs_endpoint", "gcs_keyfile",

534 541

"azure_container", "azure_account", "azure_key", "azure_endpoint", "pg_dump_options",

535 -

"dump_role_passwords", "dump_only", "upload_prefix",

542 +

"dump_role_passwords", "dump_only", "upload_prefix", "delete_uploaded",

536 543

}

537 544 538 545

gkLoop:

@@ -628,6 +635,7 @@ func loadConfigurationFile(path string) (options, error) {

628 635 629 636

opts.Upload = s.Key("upload").MustString("none")

630 637

opts.UploadPrefix = s.Key("upload_prefix").MustString("")

638 +

opts.DeleteUploaded = s.Key("delete_uploaded").MustBool(false)

631 639

opts.PurgeRemote = s.Key("purge_remote").MustBool(false)

632 640 633 641

opts.B2Bucket = s.Key("b2_bucket").MustString("")


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4