Project

General

Profile

Bug #16746

katello-backup does incremental update when same directory is used

Added by Christine Fouant almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
High
Category:
Backup & Restore
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1377636

Description of problem:

The katello-backup script runs incremental update even when `--incremental` is not set. The customer has a backup job that is running daily with the following options:

`/usr/bin/katello-backup /appl/sat-db-save`

Since they keep 10 backups in this location (in order to avoid a restore from tape) the script runs only incremental update instead of full backup, because the *.snar files are present at the given location.

79   puts "Backing up config files... " 
80 `tar --selinux --create --gzip --file=config_files.tar.gz --listed-incremental=config.snar #{CONFIGS.join(' ')}`
81 puts "Done."
82
83 puts "Backing up postgres db... "
84 `tar --selinux --create --gzip --file=pgsql_data.tar.gz --listed-incremental=postgres.snar /var/lib/pgsql/data/`
85 puts "Done."
86
87 puts "Backing up mongo db... "
88 `tar --selinux --create --gzip --file=mongo_data.tar.gz --listed-incremental=mongo.snar --exclude=mongod.lock /var/lib/mongodb/`
89 puts "Done."
90
91 unless options[:skip_pulp]
92 if @options[:online]
93 `katello-service start`
94 puts "Backing up Pulp data... "
95 matching = false
96 until matching
97 checksum1 = `find /var/lib/pulp -printf '%T
\n' | md5sum`
98 `tar --selinux --create --file=pulp_data.tar --listed-incremental=pulp.snar /var/lib/pulp/ /var/www/pub/`
99 checksum2 = `find /var/lib/pulp -printf '%T@\n' | md5sum`
100 matching = (checksum1 == checksum2)
101 end

This is very dangerous and can lead to problems when restoring, as the customer is not aware that he only does incremental updates. So in case he even does delete the backup files because he consider the backup that is created a full backup he will end up with a broken Satellite as only the last changes are saved.

Also in the documentation (https://access.redhat.com/documentation/en/red-hat-satellite/6.2/single/server-administration-guide#chap-Red_Hat_Satellite-Server_Administration_Guide-Backup_and_Disaster_Recovery), there is no hint that `katello-backup` need to have an empty directory when running without option to ensure a full backup is taken.

So either we fully specify and document this accordingly or we are fixing the code. From my point of view, should the tar command have a clause where it checks on whether incremental option is set or not and only use *.snar if incremental is set.

Version-Release number of selected component (if applicable):

katello-common-3.0.0-12.el7sat.noarch

How reproducible:

always

Steps to Reproduce:
1. Run /usr/bin/katello-backup /appl/sat-db-save
2. Run /usr/bin/katello-backup /appl/sat-db-save again
3. Check the content of /appl/sat-db-save

Actual results:

First run it takes a full backup but the second one is an incremental. Despite the fact that incremental was not set.

Expected results:

The script must always create a full backup unless incremental as option is specified

Additional info:

Associated revisions

Revision 4ac913aa (diff)
Added by Christine Fouant almost 3 years ago

fixes #16746 - creates subdirectory for backups (#299)

History

#1 Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello-packaging/pull/299 added

#2 Updated by Christine Fouant almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Justin Sherrill almost 3 years ago

  • Legacy Backlogs Release (now unused) set to 162
  • Difficulty set to easy

#4 Updated by Christine Fouant over 2 years ago

  • Status changed from Closed to Assigned

#5 Updated by Christine Fouant over 2 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF