#!/bin/bash

rsync -azP /opt/baggib2b/ root@46.224.33.150:/opt/b2b --delete
cd /tmp && sudo -u postgres pg_dump baggib2b -Fc > /tmp/baggib2b.backup
scp /tmp/baggib2b.backup root@46.224.33.150:/tmp/

# öbür makinada
export PGPASSWORD=tayitkan
dropdb baggib2b -U postgres -h 127.0.0.1
createdb -h 127.0.0.1 -U postgres baggib2b --encoding=UTF8 --locale=tr_TR.utf8 -T template0
pg_restore -h 127.0.0.1 -U postgres -d baggib2b /tmp/baggib2b.backup