Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1 KB

README.md

File metadata and controls

50 lines (34 loc) · 1 KB

savedbb

Save Database to Backblaze

Requirements

Note

Put b2 in common path so it is accessible e.g. /usr/bin

Installation

Execute as postgres user

  1. Create backup dir
mkdir -p /backups/db
  1. Get script
mkdir ~/bin
cd ~/bin
wget https://raw.githubusercontent.com/ninja-software/savedbb/master/savedbb.sh
chmod +x savedbb.sh
  1. Download, set permission, edit .savedbb.env file
cd ~
wget -O .savedbb.env https://raw.githubusercontent.com/ninja-software/savedbb/master/.savedbb.sample.env
chmod 600 .savedbb.env
nano .savedbb.env
  1. Run as cron job (as postgres user, otherwise need to specify user in pg_dump)
crontab -e

# m h  dom mon dow   command
0 10 * * * . $HOME/.savedbb.env; $HOME/bin/savedbb.sh >> $HOME/bkup.log