How Do I Backup My PostgreSQL Database with Cron?

后端 未结 8 1181
孤街浪徒
孤街浪徒 2021-01-30 09:31

I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so:

/usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase &g         


        
8条回答
  •  情话喂你
    2021-01-30 10:15

    databases=psql -h localhost -U postgres -q -x -t -c "\l" | grep 'Name' | sed 's/ //g' | sed 's/Name|//g'

提交回复
热议问题