diff options
author | Ivan Kohler <ivan@freeside.biz> | 2021-08-10 11:31:05 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2021-08-10 11:31:05 -0700 |
commit | 879ae94b7ed169d00f281d339c34dd003c23441a (patch) | |
tree | efa83a40919d0b0e1f3610941eeb81e1f220e87c | |
parent | 2a0cdfdab4e3d57d7a14c96888cf89ea63b1c9ad (diff) |
backup the schema for tables we don't need the data from. RT#85959
-rw-r--r-- | FS/FS/Cron/backup.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/Cron/backup.pm b/FS/FS/Cron/backup.pm index 2ffbda0b3..dd09f570d 100644 --- a/FS/FS/Cron/backup.pm +++ b/FS/FS/Cron/backup.pm @@ -25,7 +25,11 @@ sub backup { my $ext; if ( driver_name eq 'Pg' ) { - system("pg_dump -Fc -T h_cdr -T h_queue -T h_queue_arg -T sessions $database >/var/tmp/$database.Pg"); + system('pg_dump -Fc '. join(' ', map { "--exclude-table-data $_" } + qw( h_cdr h_queue h_queue_arg sessions ) + ). + " $database >/var/tmp/$database.Pg" + ); $ext = 'Pg'; } elsif ( driver_name eq 'mysql' ) { system("mysqldump $database >/var/tmp/$database.sql"); |