我试图通过 bash chef 资源备份一个 postgresql 基础。下面是我的代码,我收到以下错误。当我部署它们时。任何想法为什么。
$PGDATA = "node['fc_db']['postgres']['pg_data']"
bash "backup master db" do
user "postgres"
code <<-EOH
initdb –D –-no-locale –-encoding=UTF8
pg_ctl –D #{$PGDATA} start
psql –c "SELECT pg_start_backup('initial backup for SR')" template1
tar cvf pg_base_backup.tar #{$PGDATA}
psql –c "SELECT pg_stop_backup()" template1
EOH
end