The Pogo call structure is as follows:
pogo [options] <command> <source_url> [destination_url]
config del get ls put sync urls
Pogo provides help output at the top level by running pogo --help. In addition, each of the supported commands has its own help output. For example:
pogo del --help
gives usage information for the del (delete) command.
Some Pogo commands support a --force option. This can be used to overwrite existing files or disable prompts. Use this argument with caution.
You can skip configuration altogether and provide pogo with an existing s3cmd configuration file or with the username and password as command-line options.
Using an s3cmd config file:
pogo --s3cfg ~/.s3cfg get s3://com.bar.foo/baz.tgz
To use the command-line flags:
pogo --username xxxxxx --password xxxxxx get s3://com.bar.foo/baz.tgz
When operating on a directory, you must include the trailing /.
The pogo urls command lists all configured endpoints. To see the contents of an endpoint (or a directory within the endpoint), use the pogo ls <endpoint URL> command. For example, to see the contents of the com.example.pogo.quickstart S3 bucket:
pogo ls s3://com.example.pogo.quickstart/.
When no endpoint URL is provided, pogo ls behaves the same as pogo urls.
pogo ls supports several options to modify the output. Options can be provided before or after the endpoint URL:
|-c, –checksum||Print the checksum of the object|
|-l, –long||Print the date, size, and full path to the object|
|-R, –recursive||If object is a directory, list all files in all subdirectories as well|
|-s, –size||Print the size of the object in bytes (does not apply to directories)|
|-t, –timestamp||Print the last-modified timestamp of the object (does not apply to directories)|
To upload a file, use pogo put <filename> <URL>. For example, to upload data.zip from the local directory to the com.example.pogo.quickstart/data_backups/ directory:
pogo put data.zip s3://com.example.pogo.quickstart/data_backups/
To give the file a different name in S3, append the desired name:
pogo put data.zip s3://com.example.pogo.quickstart/data_backups/data-20150311.zip
pogo put will recursively upload a directory with pogo put <directory> <URL>. The behavior is identical to the sync behavior described below.
If the URL ends in a /, pogo will treat it as a directory. If it does not, pogo will treat it as a full path. In the first example above, leaving off the trailing / would upload data.zip as a file named data_backups.
To download a file, use pogo get <URL> [<filename>]. For example, to download s3://com.example.pogo.quickstart/data_backups/data.zip to the local directory:
pogo get s3://com.example.pogo.quickstart/data_backups/data.zip
To save the file as data-download.zip, use the optional filename argument:
pogo get s3://com.example.pogo.quickstart/data_backups/data.zip data-download.zip .
The get command operates on single files. To recursively sync a directory, use the pogo sync command. The source of the files is listed first, followed by the destination. To sync the data_backups directory from S3 to a local data_backups directory:
pogo sync s3://com.example.pogo.quickstart/data_backups/ data_backups
To sync the the local data_backups directory to S3:
pogo sync data_backups s3://com.example.pogo.quickstart/data_backups/ .
pogo sync will not re-transfer unchanged objects.
To remove a file from a remote endpoint, use the pogo del command. For example, to remove the data.zip file from the data_backups directory in the com.example.pogo.quickstart bucket:
pogo del s3://com.example.pogo.quickstart/data_backups/data.zip .
To remove an entire directory, use the –recursive option. For example, to remove the data_backups directory in the com.example.pogo.quickstart bucket:
pogo del --recursive s3://com.example.pogo.quickstart/data_backups/
Other pogo Commands
pogo config is used to configure pogo endpoints. It takes no arguments or options. Use of pogo config is described in the Configuration section above.
pogo urls is used to list the configured endpoints. It takes no arguments or options.
pogo cp is used to copy objects from one endpoint to another, including the local machine. The endpoints do not have to use the same credentials or be of the same type. The command syntax looks like:
pogo [OPTIONS] cp [CP OPTIONS] <source> <destination>
pogo –dryrun cp –recursive s3://com.example.pogo.quickstart/my_directory az://portal12345/my_container/
The [OPTIONS] are zero or more of the general options described in the Options section above. [CP OPTIONS are zero or more of the options described in the table below.
|–force||If given, files are uploaded/downloaded even if the destination file exists|
|–recursive||If object is a directory, copy all files contained in the directory and all sub-directories|
In addition to command-specific options, pogo supports several common options across all commands. These options must come before the command name.
|-v, –version||Show package version|
|–loglevel <level>||Modify the logging verbosity. In order of increasing verbosity: ERROR, WARN, INFO, DEBUG|
|–config <path>||Provide a specific ini format config file|
|–proxy <proxy URL>||Address of the proxy server to use|
|–proxy-port <proxy port>||Proxy server port to use|
|–retries <N>||Retry failed transfers attempts N times before giving up|
|–dryrun||Run the command without transferring or deleting anything|
|-q, –quiet||Do not print in-progress transfer status|
|-h, –help||Show help message and exit|
Proxy settings Currently, pogo only supports the use of a proxy with S3 endpoints.
- A file was not uploaded to a directory
- Ensure that the destination URL ends with a /
- URL does not match S3 pattern: s3://BUCKET/KEY error when listing an endpoint
- Ensure the endpoint URL ends with a /
- Empty directory was not uploaded
- pogo will not upload empty directories
- TypeError: Incorrect padding error when operating on an Azure Storage Account
- The Storage Account Access Key is incorrect. Re-run pogo config to update it.