Baishu
Baishu

Reputation: 1591

exclude table with autopostgresqlbackup

Is there a way to exclude a table from autopostgresqlbackup backups ?

I see the --exclude-table flag in pg_dump, but is there a clean way to use it in autopostgresqlbackup ?

Upvotes: 1

Views: 195

Answers (2)

Shriram Balakrishnan
Shriram Balakrishnan

Reputation: 509

You need to set the value (--exclude-table-data=my_table_name) of OPT in /etc/default/autopostgresqlbackup file.

If not, the default value of OPT ("") in /etc/default/autopostgresqlbackup will overwrite the value set in /usr/sbin/autopostgresqlbackup.

This file is included in the /usr/sbin/autopostgresqlbackup as follows:

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

Upvotes: 1

Baishu
Baishu

Reputation: 1591

OK, so apparently, there is no clean way.

You can hack your way to it by editing /usr/sbin/autopostgresqlbackup :

OPT=""   

to

OPT="--exclude-table=my_table"

but that might get overwritten when the package is updated.

Unfortunately, this variable is not exposed in the configuration file (/etc/default/autopostgresqlbackup).

Upvotes: 0

Related Questions