Bug #16746

katello-backup does incremental update when same directory is used

Added by Christine Fouant about 4 years ago. Updated over 2 years ago.

Backup & Restore
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

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."
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."
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."
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 (, 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):


How reproducible:


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 about 4 years ago

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


#1 Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request added

#2 Updated by Christine Fouant about 4 years ago

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

#3 Updated by Justin Sherrill about 4 years ago

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

#4 Updated by Christine Fouant almost 4 years ago

  • Status changed from Closed to Assigned

#5 Updated by Christine Fouant almost 4 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF