Because let’s be honest, why in the hell does a backup server needs to run 24x7 in many cases??
Well less rambling and more hammering! let’s me walk you through on how I did just that!
First thing first, you gonna need to figure out what you gonna backup. For me it’s the Pterodactyl’s backing up feature that we want to “clone” backups to remotely as reasonably soon as possible. Just in case the main server “blows up” so to speak.
So with the help of my two providers (LunaNode and my main provider Hostilic). I figured out the following…
Firstly a PHP script for “shelving” operations to “put the Backup VM away.”
Second another PHP script for Unshelving operations for “get the Backup VM back online and sat!”
Now to put that all together into a working Shell Script (.sh) so we can crontab (schedule) the whole ordeal…
Now that we got all of that taken cared of, this shell script that I found off of https://stackoverflow.com/a/28341234 was modified somewhat to the above. To add the needed shelving and unshelving operations.
In this way if the files are older, it will attempt to put the Backup VM “away” thus offling it. However if they are newer hence needing to be backed up they will prompt the LunaNode’s API to bring it back online for backing up. Then simply rinse and repeat!
Thereby significantly reducing my online wastefulness when it comes to backing up. As well as my computal bills. :)
Surely it’s not a “clean and cut dry” solution but hey it’s a start right? :)
OK so LunaNode is a cloud hosting provider with:
Hourly Billed KVM Cloud Servers with Snapshots, Block Storage, and More.
Good to know, nobody explained this. Currently nobody does this because the hassle of shutting down servers often costs more than the admin’s worth. For backups it even makes sense to do it, but if you have hourly backups and the stuff is billed hourly, it doesn’t add up.
I’m not sure who benefits from this: individual users? Corporations? Small companies?
Also, a server/VM uses way more energy starting up than shutting down. The best would be “freezing” a VM or putting a server in standby. I’m inspired to try that out myself, thank you :)
Your scripts are so short you can put them in a code tag right here in Lemmy; that way they don’t vanish when paste.gg is not available.
OK so LunaNode is a cloud hosting provider with:
Hourly Billed KVM Cloud Servers with Snapshots, Block Storage, and More.
Good to know, nobody explained this. Currently nobody does this because the hassle of shutting down servers often costs more than the admin’s worth. For backups it even makes sense to do it, but if you have hourly backups and the stuff is billed hourly, it doesn’t add up.
I can see some of your points but sadly am very confused on your phrasing of “it’s costs more to shutdown a server…” because unless you are at a REALLY dated provider or colocation provider… It should be be possible to shutdown a server and bring it back online all remotely. As well as automatic at times. Requiring possibly no human interactions like these scripts demotrated.
As you said though IF you actually do need hourly backups through or whatever then you MIGHT need a server at all times but…
- Have you reconsider your backup strategy to maybe offload this to more localized solutions so you are not bailing out every hour?
- If you have and worried about the local disk, had you talked to your provider or considering sticking a HDD (of course to spin up only when it needed of course) in it? Or in the cases of production VPSes/VMes adding a volume if that’s an option?
- If you still insists, don’t online TBs of storage, compute, etc if you don’t need them online this often! Instead I would consider maybe something like this TINYSERV to be online all times “bailing” to a BIGGERSERV every now and then. In the senses of backups do you really need to online 10TB of storage at all hours of a day for all days of the week? PROBABLY not, you could probably get away with say a 200GB VM instance onlining the 10TB VM instance every now and then. :)
I’m not sure who benefits from this: individual users? Corporations? Small companies?
I would say if you can do it properly per scale you can make it work for even the largest of companies. As I said above even if servers are to be online all of the time, I am sure you can to an extense rev them down and bring them back online as needed.
Not only do I think it’s good for backup servers but I think networked servers like CDNs, Hypervisors, etc can do this with fair ease if there are limited number of servers to handle the absolute base loads. Then the further servers down the line can be for variable loads in every availability zone.
Also, a server/VM uses way more energy starting up than shutting down. The best would be “freezing” a VM or putting a server in standby.
Indeed if there were an option to do such operations to freeze/pause the VM or server that would be ideal but it’s not common enough at providers to be doing this for energy.
BUT… you are still “holding onto” resources that could go to someone else (e.g. vCores, RAM, actual unit, etc) so I would only recommend this IF your needs demands such an availability option NEXT to keeping it online at all hours of the days.
I’m inspired to try that out myself, thank you :)
Aww you are very welcome! Hopefully this and other efforts can be more widespread indeed. :)
Your scripts are so short you can put them in a code tag right here in Lemmy; that way they don’t vanish when paste.gg is not available.
I had formatting issues when I tried quoting and spoiling them so I had to paste them somewhere.