Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Guru-25 committed Aug 10, 2024
1 parent b40ae09 commit e6b1adf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/db-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ jobs:
- uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Asia/Kolkata"
- name: Install PostgreSQL Client 16
- name: Install Dependencies
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-client-16
sudo apt-get install -y mariadb-client
- name: Run Shell Script
id: shell_script_run
run: bash ./db-backup.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mysql-backup
Backup PostgreSQL Database
Backup MySQL Database

## What it does?
Upload database dump to your Dropbox
Expand Down
6 changes: 3 additions & 3 deletions db-backup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

PGPASSWORD="${password}" pg_dump -h "${host}" -p "${port}" -U "${username}" -F c -b -v -f temp.dump "${database_name}"
mariadb-dump --no-tablespaces -h "${host}" -P ${port} -u "${username}" -p"${password}" "${database_name}" > temp.sql
current_time="$(date "+%Y-%m-%d_%H-%M-%S")"
file_name="${database_name}_${current_time}"
mv temp.dump "${file_name}.dump"
zip -e -P "${zip_password}" "${file_name}.zip" "${file_name}.dump" > /dev/null
mv temp.sql "${file_name}.sql"
zip -e -P "${zip_password}" "${file_name}.zip" "${file_name}.sql" > /dev/null
echo "CONFIGFILE_VERSION=2.0" > ~/.dropbox_uploader
echo "OAUTH_APP_KEY=${dropbox_app_key}" >> ~/.dropbox_uploader
echo "OAUTH_APP_SECRET=${dropbox_app_secret}" >> ~/.dropbox_uploader
Expand Down

0 comments on commit e6b1adf

Please sign in to comment.