This tool is intended to be used as support tool speed up the download of database dumps and import dumps in database. The is to be executed parallelly with database server in same virtual machine
Update and upgrade the package from apt repositories:
sudo apt update && sudo apt upgrade -y
Install the required dependency package:
sudo apt install software-properties-common -y
Add the deadsnakes PPA to the apt repository source list:
sudo add-apt-repository ppa:deadsnakes/ppa
Install Python 3.11:
sudo apt install python3.11
Install pip for Python 3.11:
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
Go to backup script directory:
cd backup_script/
Check the bash variables in script file:
pgbackup_dump.sh
Create a cron table entry to schedule the backup hourly/daily/weekly:
crontab -e
30 0 * * * postgres /u02/pgbackup/pgbackup_dump.sh
(example). Obs.: Expression editor, here look: Crontab.guru - The cron schedule expression editor
Clone the project:
git clone https://link-to-project
Go to the project directory:
cd pgimporter
Install dependencies:
pip3.11 install -r requirements.txt
Start the Gunicorn server with 4 threads as daemon:
gunicorn --bind=0.0.0.0 --workers=4 startup:app --daemon
Check all Gunicorn process:
lsof -i:8000
Kill all Gunicorn process:
pkill gunicorn
To run tests, run the following commands
Execute the pytests:
python3.11 -m test
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.