5 if [ "$#" -lt 3 ]; then
6 echo 'Need at least three arguments: service name, DB name, and backup directory names.'
14 rm -rf "${app}_backup"
16 chmod 777 "${app}_backup"
20 su postgres -lc "pg_dump -d ${db_name} --format=custom -f /tmp/${app}_backup/${db_name}.pgdump"
21 for target in "$@"; do
22 mkdir -p $(dirname "${app}_backup${target}")
23 cp -a "${target}" "${app}_backup${target}"
26 tar cf "${app}_backup.tar" "${app}_backup"
27 rm -rf "${app}_backup"
28 chown plom:plom "${app}_backup.tar"
29 mv "${app}_backup.tar" /home/plom