mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-05-30 20:02:07 -04:00
Backup config.json periodically #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CygnusHyoga on GitHub (May 6, 2020).
Hi, I always run a backup for the ddns-updater configuration. But in the last version the shell /bin/sh is not found in the docker image. Is there any change that broke the sh shell in the latest release?
Thanks!!
@github-actions[bot] commented on GitHub (May 6, 2020):
Thanks for creating your first issue 👍 Feel free to use Slack if you just need some quick help or want to chat
@qdm12 commented on GitHub (May 6, 2020):
The image is now based on Scratch (no OS, just some files + static binary and access to the Kernel) as Alpine isn't needed anymore (it was for sqlite). It's better to avoid the (many) security vulnerabilities of operating systems and is also 0 byte of image size 😉
You can run that backup command on your host OS provided you bind mounted the data directory.
Alternatively I can add some code to backup your data in a tar file periodically?
@CygnusHyoga commented on GitHub (May 6, 2020):
Thanks qdm for the reply. Wow great news, to migrate the image from alpine to scratch, it's really small :-)
It will be really great if you can add some code to make a backup periodically!! Thanks again
@qdm12 commented on GitHub (May 10, 2020):
Hi again, I have some thoughts on your backup, what exactly do you want to backup? The data/updates.json? Because your config.json should be quite constant right? I don't really see the point in backing up something not changing; maybe you want to back it up to another destination?
@CygnusHyoga commented on GitHub (May 11, 2020):
Hi, I backup the /udater/data/* folder, which includes: config.json, updates.json and the update.db. In case of some update goes wrong or some config change break the container.
Yes, I backup all the configuration to another location, I have a shared PV for backup, in a remote location for safe backup.
@qdm12 commented on GitHub (May 11, 2020):
Ok thanks. updates.db is the old database for sqlite, which is now migrated to updates.json so you can safely delete it. I'll set something to periodically tar updates.json and config.json, indeed it's a good idea if a coding monkey (=me) breaks something 😉
@CygnusHyoga commented on GitHub (May 11, 2020):
you have to be always careful in this life :-) Thanks!
@qdm12 commented on GitHub (May 11, 2020):
Would a zip file with the name ddns-update-data-<date+timestamp>.zip be ok? Or tar.gz is a must for some reason? I feel zip is more supported across platforms.
@qdm12 commented on GitHub (May 11, 2020):
I added the feature using zip files, you can now specify
BACKUP_PERIOD=24hfor example, together withBACKUP_DIRECTORY=/yourpath(note that this is inside the container, not on your host). It will create a zip file containing updates.json and config.json together, with the unix nanoseconds timestamp so you can sort the filenames.@CygnusHyoga commented on GitHub (May 12, 2020):
Yes, podname(tag app=name)+date+timestamp is what I being used, ddns-update-data-<date+timestamp>.zip it's fine because now we don't have to run external job with the podname :-). I've no reason for tar format, you are right he zip format is more standard across platforms. Thanks Qdm!!, I will try the new feature and comment!
@CygnusHyoga commented on GitHub (May 19, 2020):
I confirm...It's working great!!! A big, big, big thanks!!!
@qdm12 commented on GitHub (May 19, 2020):
Glad it works 👍 Enjoy!