diff --git a/manifests/server/backup.pp b/manifests/server/backup.pp index bc4f925f5..07345f00e 100644 --- a/manifests/server/backup.pp +++ b/manifests/server/backup.pp @@ -29,7 +29,7 @@ # @param backupdirgroup # Group owner for the backup directory. This parameter is passed directly to the file resource. # @param backupcompress -# Whether or not to compress the backup (when using the mysqldump provider) +# Whether or not to compress the backup (when using the mysqldump or xtrabackup provider) # @param backupmethod # The execution binary for backing up. ex. mysqldump, xtrabackup, mariabackup # @param backup_success_file_path diff --git a/templates/xtrabackup.sh.erb b/templates/xtrabackup.sh.erb index bc01ba9e4..c12cd07ad 100644 --- a/templates/xtrabackup.sh.erb +++ b/templates/xtrabackup.sh.erb @@ -43,6 +43,10 @@ cleanup <%- _innobackupex_args = '--user="' + @backupuser + '" --password="' + @backuppassword + '"' -%> <%- end -%> +<%- if @backupcompress -%> + <%- _innobackupex_args = _innobackupex_args + ' --compress' -%> +<%- end -%> + <%- if @backupdatabases and @backupdatabases.is_a?(Array) and !@backupdatabases.empty? -%> <%- _innobackupex_args = _innobackupex_args + ' --databases="' + @backupdatabases.join(' ') + '"' -%> <%- end -%>