Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function "rm_old()" is not working for single DB backups #9

Open
cmonty14 opened this issue Nov 23, 2018 · 1 comment
Open

Function "rm_old()" is not working for single DB backups #9

cmonty14 opened this issue Nov 23, 2018 · 1 comment
Assignees

Comments

@cmonty14
Copy link

cmonty14 commented Nov 23, 2018

Hi,
I have defined this configuration file:

ct117-nextcloud:~# more /etc/mariadb-backup.conf
# mariabackup configuration file

#
# Common parameters
#

# cnf file - Can be overwrite with "-r" option
MY_MYSQLEXTRAFILE='/etc/my.cnf.d/backup.cnf'

# log file for script output
MY_LOGFILE='/var/log/mariadb-backup.log'

# Destination forleder for the backup files
MY_MARIADB_DEST_DIR='/backups/mariadb'

# Number of _days_ to keep backup files
MY_BCKPDAYS='15'

# Activate debug mode (default = off)
MY_DEBUG=0

# MariaDB binlog are enable (default = off)
MY_BINLOG=0

My backup strategy is to

  • run daily backup of DB "Nextcloud"

  • run weekly backup of all DBs.

This is the current content in the backup directory:

ct117-nextcloud:~# ls /backups/mariadb/ | sort
20181028_0200_nextcloud.sql.gz
20181028_nextcloud.sql.gz
20181029_nextcloud.sql.gz
20181030_nextcloud.sql.gz
20181031_nextcloud.sql.gz
20181101_nextcloud.sql.gz
20181102_nextcloud.sql.gz
20181103_0300_nextcloud.sql.gz
20181103_mysql.sql.gz
20181103_nextcloud.sql.gz
20181104_nextcloud.sql.gz
20181105_nextcloud.sql.gz
20181106_nextcloud.sql.gz
20181107_nextcloud.sql.gz
20181108_nextcloud.sql.gz
20181109_nextcloud.sql.gz
20181110_0300_nextcloud.sql.gz
20181110_mysql.sql.gz
20181110_nextcloud.sql.gz
20181111_nextcloud.sql.gz
20181112_nextcloud.sql.gz
20181113_nextcloud.sql.gz
20181114_nextcloud.sql.gz
20181115_nextcloud.sql.gz
20181116_nextcloud.sql.gz
20181117_0300_nextcloud.sql.gz
20181117_mysql.sql.gz
20181117_nextcloud.sql.gz
20181118_nextcloud.sql
20181119_nextcloud.sql
20181120_nextcloud.sql
20181121_nextcloud.sql
20181122_nextcloud.sql
20181123_nextcloud.sql

You can see that old backups with naming convention "yyyymmdd_nextcloud.sql.gz" are not removed although the retention time is set to 15 days.

Based on my investigation this is caused by this coding:

# Run purge
if [ "${MY_BDD}" == 'all' ] ; then
  backup_test 'in_delete'
  rm_old "${MY_BCKPDAYS}"
fi

My interpretation of this coding is that function rm_old will only be called if a backup of all DBs is running.
However I don't think this is a reasonable restriction.

@cmonty14 cmonty14 changed the title Function "rm_old()" is not working Function "rm_old()" is not working for single DB backups Nov 23, 2018
@cmonty14
Copy link
Author

Any update on this issue?

@JGroselle JGroselle self-assigned this Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants