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

Enable pre and post commands #46

Merged
merged 5 commits into from
Jan 10, 2022

Conversation

jan-brinkmann
Copy link
Contributor

This enables us to execute commands before and after the backup has been transferred to /archive.

These commands are given by PRE_COMMAND and POST_COMMAND.
In the example docker-compose.yml, all backups as listed before the current backup is tansferred. Afterwards, all backups older than seven days are removed.

Comment on lines +231 to +232
`PRE_COMMAND` | | Commands that is executed before the backup is transferred to `/archive`.
`POST_COMMAND` | | Commands that is executed after the backup has been transferred to `/archive`.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
`PRE_COMMAND` | | Commands that is executed before the backup is transferred to `/archive`.
`POST_COMMAND` | | Commands that is executed after the backup has been transferred to `/archive`.
`PRE_COMMAND` | | Command that is executed before the backup is transferred to `/archive`.
`POST_COMMAND` | | Command that is executed after the backup has been transferred to `/archive`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typos - thank you!

PRE_COMMAND: "ls -la /archive"
# Command that is executed after the backup has been transferred:
# "Delete all files in /archive that are older than seven days."
POST_COMMAND: "rm $$(find /archive/* -mtime +7)"
Copy link
Owner

Choose a reason for hiding this comment

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

Beautifully concise 👏

@jareware jareware merged commit 612e633 into jareware:master Jan 10, 2022
@jareware jareware mentioned this pull request Jan 10, 2022
@jan-brinkmann jan-brinkmann deleted the Enable-pre-and-post-commands branch January 10, 2022 18:09
mpietruschka pushed a commit to pietmacom/docker-volume-backup that referenced this pull request Mar 25, 2023
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.

2 participants