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

Adding remove-all-but-n-full, remove-all-inc-of-but-n-full scripts #7

Closed
darron1217 opened this issue Nov 28, 2017 · 4 comments
Closed

Comments

@darron1217
Copy link

darron1217 commented Nov 28, 2017

@blacklabelops
Maybe this issue is related with issue #5 .
This request is simply adding 2 removing method to the plugin, so that most issues dealing with removing method will be solved :)

I don't know much about shell scripting.. but I just made an example to explain the request

e.g.
at /imagescripts/create_scripts.sh

cat > ${VOLUMERIZE_SCRIPT_DIR}/remove-all-but-n-full <<_EOF_
#!/bin/bash
set -o errexit
exec ${DUPLICITY_COMMAND} remove-all-but-n-full ${PARAMETER_PROXY} ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_TARGET}
_EOF_

cat > ${VOLUMERIZE_SCRIPT_DIR}/remove-all-inc-of-but-n-full <<_EOF_
#!/bin/bash
set -o errexit
exec ${DUPLICITY_COMMAND} remove-all-inc-of-but-n-full ${PARAMETER_PROXY} ${DUPLICITY_OPTIONS} ${VOLUMERIZE_INCUDES} ${VOLUMERIZE_TARGET}
_EOF_

e.g.
Removing all except for 1 full backup set on every 3 a.m.

$ docker run -d \
    --name volumerize \
    -v jenkins_volume:/source:ro \
    -v backup_volume:/backup \
    -e "VOLUMERIZE_SOURCE=/source" \
    -e "VOLUMERIZE_TARGET=file:///backup" \
    -e "JOB_NAME2=RemoveOldFullBackups" \
    -e "JOB_COMMAND2=/etc/volumerize/remove-all-but-n-full 1" \
    -e "JOB_TIME2=0 0 3 * * *" \
    blacklabelops/volumerize

It was just my imagination :)
Can it be implemented?

@darron1217
Copy link
Author

Actually, I found workaround with this problem.. haha

e.g.

       JOB_NAME2: RemoveOldFullBackups
       JOB_COMMAND2: duplicity remove-all-but-n-full 1 $${VOLUMERIZE_TARGET} --force
       JOB_TIME2: 0 0 * * * *

But anyway, it can be clearer if those methods are implemented as a script :)

@blacklabelops
Copy link
Owner

Scripts are added, please wait till image is build and check.

@darron1217
Copy link
Author

@blacklabelops You are the best 👍
I'll check this as soon as image updated :)

@darron1217
Copy link
Author

It's working perfectly!

Really appreciate for the feedbacks :)

dbuch0 added a commit to dbuch0/volumerize that referenced this issue Mar 21, 2018
Added a section for Additional Jobber Cron Jobs (mostly copied from comments in Closed Issue blacklabelops#7). Corrected example for 1 month in Enforcing Full Backups Periodically.
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

No branches or pull requests

2 participants