mkdir -p /opt/backup/app # this is because we usually do repository backup to sibling directories in the tree chown postgres:postgres /opt/backup chown root:root /opt/backup/app chmod 700 /opt/backup/app # deploy the script above: vim /opt/backup/backup_app.sh chown root:root /opt/backup/backup_app.sh chmod 750 /opt/backup/backup_app.sh