Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用autopostgresqlbackup排除表_Postgresql_Ubuntu_Backup - Fatal编程技术网

使用autopostgresqlbackup排除表

使用autopostgresqlbackup排除表,postgresql,ubuntu,backup,Postgresql,Ubuntu,Backup,有没有办法从备份中排除表 我在pg_dump中看到了--exclude table标志,但是在autopostgresqlbackup中是否有干净的方法使用它呢?好的,显然没有干净的方法 您可以通过编辑/usr/sbin/autopostgresqlbackup来破解它: OPT="" 到 但当包更新时,这可能会被覆盖 遗憾的是,此变量未在配置文件(/etc/default/autopostgresqlbackup)中公开。您需要在/etc/default/autopostgresqlb

有没有办法从备份中排除表


我在pg_dump中看到了
--exclude table
标志,但是在autopostgresqlbackup中是否有干净的方法使用它呢?

好的,显然没有干净的方法

您可以通过编辑
/usr/sbin/autopostgresqlbackup
来破解它:

OPT=""   

但当包更新时,这可能会被覆盖

遗憾的是,此变量未在配置文件(
/etc/default/autopostgresqlbackup
)中公开。

您需要在
/etc/default/autopostgresqlbackup
文件中设置
OPT
的值(--exclude table data=my_table_name)

如果不是,则
/etc/default/autopostgresqlbackup
中的默认值OPT(“”)将覆盖
/usr/sbin/autopostgresqlbackup
中设置的值

此文件包含在
/usr/sbin/autopostgresqlbackup
中,如下所示:

if [ -f /etc/default/autopostgresqlbackup ]; then
    . /etc/default/autopostgresqlbackup
fi

什么是
autopostgresqlbackup
。是的。是否有另一个“标准”包来处理带轮换的每日/每周/每月备份?或多或少的标准方法是创建一个调用pg_dump(并处理轮换)的shell脚本。从cron调用。我猜
autopostgresqlbackup
也有类似的功能。
if [ -f /etc/default/autopostgresqlbackup ]; then
    . /etc/default/autopostgresqlbackup
fi