From 891b6495e3c422ac4dd96b0b40d1df86d92aa433 Mon Sep 17 00:00:00 2001 From: Arne Date: Sun, 22 Jan 2023 15:23:32 +0100 Subject: [PATCH] Create README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..463bf87 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Postgres Backup and Restore Script + +This is a bash script that allows you to backup and restore a specified PostgreSQL database with a timestamp in the backup file's name. + +## Usage +``` +./script.sh [-b|--backup] [-r|--restore] [-d|--database] [-h|--help] database_name +``` +- **-b** or **--backup**: backup the specified database +- **-r** or **--restore**: restore the specified database +- **-d** or **--database**: specify the name of the database +- **-h** or **--help**: display the usage help text + +## Example +``` +./script.sh -b -d mydatabase +``` + +This will backup the database `mydatabase` +``` +./script.sh -r -d mydatabase +``` + +This will restore the database `mydatabase` from the latest backup file. + +## Requirements +- postgresql +- postgresql_utils + +## Deployment +This script can be deployed using nix package manager, you can find an example of a `flake.nix` file in the repository that you can use to deploy the script and its dependencies. + +Please make sure you don't overwrite any important files by creating a new backup file with the same name.