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

Rotate backups #33

Closed
pogzie opened this issue May 16, 2020 · 4 comments
Closed

Rotate backups #33

pogzie opened this issue May 16, 2020 · 4 comments
Assignees

Comments

@pogzie
Copy link

pogzie commented May 16, 2020

Please add backup rotation feature as the backups tend to pile up after some time.

@aghadjip
Copy link

aghadjip commented Jul 6, 2020

a quick option would be to cron something like

rm ls -t | awk 'NR>10'`

replacing 10 with however many you want to keep. The above will keep the 10 newest, removing the rest. Dry run by removing the rm -rf command to see what it will do. I add the above to my crontab running weekly, i bash script move the archives to a longer term storage and delete.
Edit, good lord, i cant get the ticks to stick. rm followed by backticks around the ls command is what im trying to show

@pogzie
Copy link
Author

pogzie commented Aug 18, 2020

Thanks. I've currently thrown all the backups to my network drive for now. Im avoiding destructive rms on the script but hopefully dev would consider this in the future to add an nBackupDays variable or something.

@TheRemote
Copy link
Owner

This is great, I need to add it to my Raspberry Pi Java Minecraft server script as well. I'll add it here for the next version!

@TheRemote
Copy link
Owner

Added in latest version

@TheRemote TheRemote self-assigned this May 11, 2022
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

3 participants