{"id":22446003,"url":"https://github.com/richbl/postgresql-db-dump","last_synced_at":"2026-02-28T20:43:15.811Z","repository":{"id":36796906,"uuid":"41103718","full_name":"richbl/postgresql-db-dump","owner":"richbl","description":"shell script to perform a remote postgreSQL database dump","archived":false,"fork":false,"pushed_at":"2024-12-10T22:31:07.000Z","size":42,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T20:44:32.667Z","etag":null,"topics":["bash","bash-script","database","dump","postgres","postgresql","postgresql-database","shell","shell-script"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richbl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-20T15:31:49.000Z","updated_at":"2025-02-09T14:43:26.000Z","dependencies_parsed_at":"2025-08-01T20:37:16.066Z","dependency_job_id":"70edbcf5-3537-464f-a3f4-a27d152356cf","html_url":"https://github.com/richbl/postgresql-db-dump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richbl/postgresql-db-dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richbl%2Fpostgresql-db-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richbl%2Fpostgresql-db-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richbl%2Fpostgresql-db-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richbl%2Fpostgresql-db-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richbl","download_url":"https://codeload.github.com/richbl/postgresql-db-dump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richbl%2Fpostgresql-db-dump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29951659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","database","dump","postgres","postgresql","postgresql-database","shell","shell-script"],"created_at":"2024-12-06T03:17:57.239Z","updated_at":"2026-02-28T20:43:15.746Z","avatar_url":"https://github.com/richbl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postgresql-Db-Dump\n\n**Postgresql-Db-Dump** (`postgres_dump_db.sh`) permits for the remote dump of a PostgreSQL database. It takes a number of command-line parameters, and if run successfully, returns a date-and-time-stamped compressed file (useful for a running backup archive).\n\nThis script expects that the host is properly configured to accept remote logins, and that the Postgres user (technically called a *role* in Postgres) is apppropriately associated with the database in question.\n\n## Run_postgres_dump_db.sh\nThe associated script, `run_postgres_dump.sh`, is really just a front-end script that calls into `postgres_dump_db.sh` with a predefined set of parameters passed in. Useful for automating the dump process (*e.g.*, executing via a cronjob).\n\n## [\u003cimg src=\"https://github.com/user-attachments/assets/4dc1e16e-3fd3-481c-9a43-b027c029dd27\" width=\"150\" /\u003e](https://github.com/richbl/a-bash-template)[Developed with a Bash Template (BaT)](https://github.com/richbl/a-bash-template)\n\n**Postgresql-Db-Dump** uses a bash template (BaT) called **[A-Bash-Template](https://github.com/richbl/a-bash-template)** designed to make script development and command line argument management more robust, easier to implement, and easier to maintain. Here are a few of those features:\n\n- Dependencies checker: a routine that checks all external program dependencies (*e.g.*, [sshpass](http://linux.die.net/man/1/sshpass) and [jq](https://stedolan.github.io/jq/))\n- Arguments and script details--such as script description and syntax--are stored in the [JSON](http://www.json.org/) file format (*i.e.*, `config.json`)\n- JSON queries (using [jq](https://stedolan.github.io/jq/)) handled through wrapper functions\n- A script banner function automates banner generation, reading directly from `config.json`\n- Command line arguments are parsed and tested for completeness using both short and long-format argument syntax (*e.g.*, `-u|--username`)\n- Optional command line arguments are permissible and managed through the JSON configuration file\n- Template functions organized into libraries to minimize code footprint in the main script\n\nFor more details about using a bash template, [check out the BaT sources here](https://github.com/richbl/a-bash-template).\n\n## Basic Usage\n**Postgresql-Db-Dump** is run through an interactive command line interface, so all of the command options are made available there.\n\nHere's the default response when running `postgres_dump_db.sh` with no arguments:\n\n\n\t |\n\t | A bash script to dump a remote PostgreSQL database\n\t |   0.2.0\n\t |\n\t | Usage:\n\t |   postgres_db_dump -h host -u username -p password -d database -o output_dir\n\t |\n\t |   -h, --host \twebsite URL or IP address\n\t |   -u, --username \tuser name\n\t |   -p, --password \tpassword\n\t |   -d, --database \tPostgreSQL database name\n\t |   -o, --output_dir \tabsolute directory path to save dumped file\n\t |\n\n\tError: host argument (-h|--host) missing.\n\tError: username argument (-u|--username) missing.\n\tError: database argument (-d|--database) missing.\n\tError: output_dir argument (-o|--output_dir) missing.\n\nIn this example, the program responds by indicating that the required script arguments must be set before proper operation.\n\nWhen arguments are correctly passed, the script provides feedback on the success or failure of the remote folder copy:\n\n\t$ ./postgres_db_dump.sh -h example.com -u remote_user -p 'pass123' -d dbname -o /home/user\n\n\t |\n\t | A bash script to dump a remote PostgreSQL database\n\t |   0.2.0\n\t |\n\t | Usage:\n\t |   postgres_db_dump -h host -u username -p password -d database -o output_dir\n\t |\n\t |   -h, --host \twebsite URL or IP address\n\t |   -u, --username \tuser name\n\t |   -p, --password \tpassword\n\t |   -d, --database \tPostgreSQL database name\n\t |   -o, --output_dir \tabsolute directory path to save dumped file\n\t |\n\n\tStarting database dump now... this could take some time depending on database size.\n\n\tSuccess: PostgreSQL dump completed. Results file (dbname-database-20160414082441.gz) created in /home/user.\n\n## IMPORTANT: This Project Uses Git Submodules \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://user-images.githubusercontent.com/10182110/208980142-08d4cf6e-20ac-4243-ac69-e056258b0315.png\" width=\"150\"\u003e\u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://user-images.githubusercontent.com/10182110/208980142-08d4cf6e-20ac-4243-ac69-e056258b0315.png\" width=\"150\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/10182110/208980142-08d4cf6e-20ac-4243-ac69-e056258b0315.png\" width=\"150\"\u003e\u003c/picture\u003e\n\nThis project uses [Git submodule project(s)](https://git-scm.com/book/en/v2/Git-Tools-Submodules) (located in the `bash-lib` folder) to keep this project up-to-date without manual intervention.\n\n**Be sure to clone this project with the `--recursive` switch** (`git clone --recursive https://github.com/richbl/this_project`) so any submodule project(s) will be automatically cloned as well. If you clone into this project without this switch, you'll likely see empty submodule project folders (depending on your version of Git).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichbl%2Fpostgresql-db-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichbl%2Fpostgresql-db-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichbl%2Fpostgresql-db-dump/lists"}