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

[enh] Tranfer backup_core_only to BACKUP_CORE_ONLY #398

Merged
merged 5 commits into from
Mar 15, 2018

Conversation

maniackcrudelis
Copy link
Contributor

Problem

  • It can be hard to handle the value of backup_core_only when it's in settings.yml, especially with restore script.

Solution

  • Do not use backup_core_only in settings.yml anymore. But use an environment variable, passed only to the backup script when this helper is used.

@@ -77,7 +77,7 @@ ynh_backup_before_upgrade () {
fi

# Create backup
sudo yunohost backup create --ignore-system --apps $app --name $app_bck-pre-upgrade$backup_number
sudo BACKUP_CORE_ONLY=1 yunohost backup create --ignore-system --apps $app --name $app_bck-pre-upgrade$backup_number
Copy link
Member

Choose a reason for hiding this comment

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

Did you test this ? I'm not sure that the value of BACKUP_CORE_ONLY is propataged to the actual backup script... 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember I already try that. But without all the new commits.
Let's try that right now ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tried with nextcloud (and some upgrade of my helpers and of nextcloud scripts to follow this PR). It works as expected.
In fact, it works because the variable is set in the same line than the yunohost command. So, the shell launch by YunoHost keep the value of the variable.

The only problem here that to use the argument IS_BIG, you need to use a second argument, so the third one can be IS_BIG.
IS_BIG should not be associated to $3 as a positional parameter, but be an option, like --is-big.

@alexAubin
Copy link
Member

Yolomerging as it's a small PR and opened since like 4 months

@alexAubin alexAubin merged commit fc85376 into unstable Mar 15, 2018
@alexAubin alexAubin deleted the backup_core_only branch March 15, 2018 16:32
@alexAubin alexAubin added this to the 2.7.x milestone May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants