a backup script to send backups over email when changed#131
Open
gasche wants to merge 1 commit intokohler:masterfrom
Open
a backup script to send backups over email when changed#131gasche wants to merge 1 commit intokohler:masterfrom
gasche wants to merge 1 commit intokohler:masterfrom
Conversation
This is a home-grown backup script that I built for a local HotCRP installation, but I thought that it may be useful to others as well. The backup strategy is as follows: - a backups/ directory at the project root with at most two backups saved, the last one (`new`) and the one before that (`old`) - whenever the script runs, it moves `new` to `old` and creates a new `new` file using the `backupdb.sh` script; then it compares `new` and `old`, and sends the new backup by email if it differs from the old one - if a `passphrase` file exists in the `backups` directory, then it is used as a passphrase for `gpg` to encrypt the backup file Finally, note that we are careful to pass `--skip-dump-date` to `mysqldump`, otherwise the backups would always differ. The script is careful to `cd` to its base directory, so that it can be invoked directly from a crontab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a home-grown backup script that I built for a local HotCRP
installation, but I thought that it may be useful to others as
well. The backup strategy is detailed as follows:
a backups/ directory at the project root with at most two backups saved,
the last one (
new) and the one before that (old)whenever the script runs, it moves
newtooldand creates a newnewfile using thebackupdb.shscript; then it comparesnewand
old, and sends the new backup by email if it differs from theold one
if a
passphrasefile exists in thebackupsdirectory, thenit is used as a passphrase for
gpgto encrypt the backup fileImplementation remarks:
--skip-dump-datetomysqldump, otherwise the backups would always differcdto its base directory, so that the script can be invoked directly from a crontab.