-
Notifications
You must be signed in to change notification settings - Fork 317
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
base: development
Are you sure you want to change the base?
Issue #590 Automatic Site Backup #1408
Conversation
There was a problem hiding this 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)
src/scripts/backupScript.sh
Outdated
# | ||
|
||
# Input the pathname for the desired backup directory | ||
# ie PATH="/home/<your_username>/path_to/database_dumps/dump.sql" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/scripts/backupScript.sh
Outdated
# 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
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
Checklist
Limitations
The cron template will be mentioned in the comments, that documentation will be need to be added to the webpage.