- #!/bin/sh
- echo "$(date) backup start"
- export PGPASSWORD='gC5jP3oM1tQ8'
- backup_dir=/data/ts_acl_backup/$(date +%Y%m%d%H%M%S)
- mkdir -p "${backup_dir}"
- host='192.168.70.136'
- port='9999'
- username='ts_acl'
- dbname='ts_acl'
- jobs='24'
- echo "pg_dump -h ${host} -p ${port} -U ${username} -d ${dbname} -v -O -Fd -j ${jobs} -Z9 -f ${backup_dir}"
- pg_dump -h "${host}" -p "${port}" -U "${username}" -d "${dbname}" -v -O -Fd -j "${jobs}" -Z9 -f "${backup_dir}"
- echo "$(date) backup end"
|