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

Issue #590 Automatic Site Backup #1408

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

vladoleksiyenko
Copy link
Contributor

Description

Fixed the script that was previously mentioned in the closed PR 759. This along with the cron job template that will be mentioned in the #590 issue will allow automatic backup of the website.

Fixes #590

Collaborators

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the [OED pull request]
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the [OED Contributing License Agreement] and each author is listed in the Description section.

Limitations

The cron template will be mentioned in the comments, that documentation will be need to be added to the webpage.

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

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

Thanks to @MattMiss, @vladoleksiyenko, @brandonviorato & @Gene7Him for addressing this issue. Testing found it mostly works as expected. I make a few comment to consider. Also, OED is likely to create a cron job template to allow sites to automatically run this script at desired intervals. Let me know if you want to be involved in that and I can give more details. (removed since I realized you had put a file on the issue)

#

# Input the pathname for the desired backup directory
# ie PATH="/home/<your_username>/path_to/database_dumps/dump.sql"
Copy link
Member

Choose a reason for hiding this comment

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

This isn't really an explicit path but a file location including the path. Maybe update the comment. Maybe also note that it will be the file listed but with the date and give an example.

Also, if the directory does not exist then this fails. At a minimum there should be a comment if that is the case. An alternative is to check if there it exists and create if it does not. Helpful for the first time this runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an if statement that checks to see if the file path exists, and lets the user know if it exists. If not, it attempts to create the database_dumps directory. If this is unsuccessful, a message will then be displayed saying it failed. Thank you for bringing this up.

# This could probably be programmatically populated. Currently needs to be set manually
db_dump_path="/home/<your_username>/database_dumps" #INPUT REQUIRED

# Generate a timestamp to append to the dump file. This line has errors at the moment.
Copy link
Member

Choose a reason for hiding this comment

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

This is working fine for me. Is there still an issue you see?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies, this was a comment that we forgot to remove originally, there aren't any issues with this. Thank you for noticing that.

# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# Input the pathname for the desired backup directory
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to put in a comment at the start that the OED database Docker container must be running for this to work. It also assumes it is the only database container running (seems likely).

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've included a message at the top that mentions this now, thank you for that suggestion.

… errors, indicated that OED docker database container must be running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatic site backup
2 participants