Backup config.json periodically #30

Closed
opened 2025-11-20 04:19:04 -05:00 by saavagebueno · 12 comments
Owner

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?

oc rsh ddns-updater-x-xxx /bin/sh -i -c 'tar -zcvf /backup/ddns-updater.apps.xxx.com.ar/ddns-updater.20200501.tar.gz /updater/data'

rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:235: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory"

Thanks!!

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? ``` oc rsh ddns-updater-x-xxx /bin/sh -i -c 'tar -zcvf /backup/ddns-updater.apps.xxx.com.ar/ddns-updater.20200501.tar.gz /updater/data' rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:235: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory" ``` Thanks!!
Author
Owner

@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

@github-actions[bot] commented on GitHub (May 6, 2020): Thanks for creating your first issue :+1: Feel free to use [Slack](https://join.slack.com/t/qdm12/shared_invite/enQtODMwMDQyMTAxMjY1LTU1YjE1MTVhNTBmNTViNzJiZmQwZWRmMDhhZjEyNjVhZGM4YmIxOTMxOTYzN2U0N2U2YjQ2MDk3YmYxN2NiNTc) if you just need some quick help or want to chat
Author
Owner

@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?

@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 :wink: 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?
Author
Owner

@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

@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
Author
Owner

@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?

@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?
Author
Owner

@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.

@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.
Author
Owner

@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 😉

@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 :wink:
Author
Owner

@CygnusHyoga commented on GitHub (May 11, 2020):

you have to be always careful in this life :-) Thanks!

@CygnusHyoga commented on GitHub (May 11, 2020): you have to be always careful in this life :-) Thanks!
Author
Owner

@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): 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.
Author
Owner

@qdm12 commented on GitHub (May 11, 2020):

I added the feature using zip files, you can now specify BACKUP_PERIOD=24h for example, together with BACKUP_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.

@qdm12 commented on GitHub (May 11, 2020): I added the feature using zip files, you can now specify `BACKUP_PERIOD=24h` for example, together with `BACKUP_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.
Author
Owner

@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 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!
Author
Owner

@CygnusHyoga commented on GitHub (May 19, 2020):

I confirm...It's working great!!! A big, big, big thanks!!!

@CygnusHyoga commented on GitHub (May 19, 2020): I confirm...It's working great!!! A big, big, big thanks!!!
Author
Owner

@qdm12 commented on GitHub (May 19, 2020):

Glad it works 👍 Enjoy!

@qdm12 commented on GitHub (May 19, 2020): Glad it works :+1: Enjoy!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#30