Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

fixes #19743, #18358 - allows user to bypass subdir creation #460

Merged
merged 1 commit into from Jul 5, 2017

Conversation

cfouant
Copy link
Member

@cfouant cfouant commented Jun 1, 2017

No description provided.

@theforeman-bot
Copy link

There were the following issues with the commit message:

  • length of the first commit message line for 1014753 exceeds 65 characters

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@cfouant cfouant changed the title fixes #19743 - allows user to bypass timestamped subdirectory fixes #19743, #18358 - allows user to bypass subdir creation Jun 1, 2017
@johnpmitsch
Copy link
Contributor

Not related to this PR, but it looks like incremental is broken

[root@steak ~]# /home/vagrant/katello-packaging/katello/katello-backup --incremental /backup/no_subdir_with_inc/
katello-backup: **** ERROR: Please specify an export directory ****

Assuming I have the right syntax here, it looks like this check is still going to run even though --incremental is using the directory argument

If this is correct, I can file an issue and fix

@johnpmitsch
Copy link
Contributor

The reason I was testing --incremental (above comment) is because I am wondering what happens if I run --incremental and --preserve-directory, will there be a subdirectory created?

Copy link
Contributor

@johnpmitsch johnpmitsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting this message when running with --preserve-directory on an existing backup

gzip: pgsql_data.tar.gz already exists; do you wish to overwrite (y or n)? gzip: mongo_data.tar.gz already exists; do you wish to overwrite (y or n)?

This will be an issue for those who are going to use a cron job to backup to the same directory. I am thinking we should remove all files in the backup with a yes/no confirmation that their backup will be overwritten. (that can be overridden with -y/--yes kind of thing).

@cfouant
Copy link
Member Author

cfouant commented Jun 7, 2017

@johnpmitsch you'd still need to define the backup directory so it would look something like:

# katello-backup /tmp/backup --incremental /tmp/backup --preserve-directory

Running --preserve-directory will not create a subdirectory no matter what other options are listed. Using this with --incremental would probably be the most likely scenario.

@johnpmitsch
Copy link
Contributor

johnpmitsch commented Jun 7, 2017

@cfouant so I could do something like
katello-backup /tmp/backup --incremental /tmp/mylargebackup --preserve-directory /tmp/mylargebackup and do an incremental backup that replaces the base backup?

@johnpmitsch
Copy link
Contributor

I am thinking we should remove all files in the backup with a yes/no confirmation that their backup will be overwritten. (that can be overridden with -y/--yes kind of thing).

Actually reconsidering my suggestion... If we remove the directory and the backup fails, a user could be left backup-less. Maybe we could move the files in the directory to a temporary directory that gets deleted at the end of the script? @ehelms or @jlsherrill may have other ideas (see here for context)

@cfouant
Copy link
Member Author

cfouant commented Jun 8, 2017

@johnpmitsch I added a '-f' so you should no longer get that error. It will overwrite the existing files without interrupting the backup now.

@cfouant
Copy link
Member Author

cfouant commented Jun 8, 2017

@johnpmitsch the command would look different. The --preserve-directory flag does not require any arguments.

# katello-backup <backup directory location> --incremental <existing backup directory to increment from> --preserve-directory

So in the case of wanting the incremental directory to be the same as the location which you're overwriting, it would look like this:

# katello-backup /tmp/my_backup_directory --incremental /tmp/my_backup_directory --preserve-directory

@johnpmitsch
Copy link
Contributor

@cfouant I am seeing this when running /katello-backup --preserve-directory /backup/katello-backup-20170608184218/

gzip: pgsql_data.tar.gz already exists; do you wish to overwrite (y or n)? gzip: mongo_data.tar.gz already exists; do you wish to overwrite (y or n)? y
gzip: f: No such file or directory

@cfouant
Copy link
Member Author

cfouant commented Jun 27, 2017

@johnpmitsch - please rereview, thanks!

@cfouant
Copy link
Member Author

cfouant commented Jun 27, 2017

[test]

@johnpmitsch johnpmitsch merged commit bbaff09 into Katello:master Jul 5, 2017
@johnpmitsch
Copy link
Contributor

nice change @cfouant!

@cfouant cfouant deleted the no-subdir branch July 6, 2017 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants