Bacula postgresql目录备份

当我运行BackupCatalog作业时,出现以下错误

04-Mar 21:04 storo-dir JobId 62: shell command: run BeforeJob "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog" 04-Mar 21:04 storo-dir JobId 62: BeforeJob: pg_dump: [archiver (db)] connection to database "bacula" failed: FATAL: no PostgreSQL user name specified in startup packet 04-Mar 21:04 storo-dir JobId 62: Error: Runscript: BeforeJob returned non-zero status=1. ERR=Child exited with code 1 04-Mar 21:04 storo-dir JobId 62: Error: Bacula storo-dir 5.0.3 (04Aug10): 04-Mar-2012 21:04:35 

好的,我看了一下脚本:

  • 第一个参数应该是数据库的名称
  • 第二个用户
  • 第三个密码
  • 第四个数据库的地址

但是如果我用所有参数在bacula中运行脚本。 我得到:

 04-Mar 21:23 storo-dir JobId 63: BeforeJob: Can't find your catalog (bacula) in director configuration 

有人可以帮我,告诉我什么是错的?

不,这是错误的:第一个名称是目录的名称(MyCatalog,根据第一个数据库的输出); 所以,我猜你正在运行这样的脚本:

 /etc/bacula/scripts/make_catalog_backup.pl db_name user password host 

但是你应该做的是:

 /etc/bacula/scripts/make_catalog_backup.pl MyCatalog db_name user password host