Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
This part caught my eye. You were able to do all that other stuff without ever attempting to write a script? That's surprising and awesome. Assuming you are running everything on a linux server, I feel like a bash script that is run via a cronjob would be your best bet, no need to ssh into the server, just let it do it on it's own. I haven't tested any of this but I do have scripts I wrote that do automatic ZFS backups and scrubs; the order should go something like:
open the terminal on the server and type
mkdir scripts
cd scripts
nano docker-updates.sh
type something along the lines of this (I'm still learning docker so adjust the commands to your needs)
save the file and then type
sudo chmod +x ./docker-updates.sh
to make it executableand finally set up a cronjob to run the script at specific intervals. type
crontab -e
or
sudo crontab -e
(this is if you want to run the script as root but ideally, you just add your user to the docker group so this shouldn't be needed)and at the bottom of the file type this and save, that's it:
this website will help you choose a different interval
For OS updates you basically do the same thing except the script would look something like: (I forget if you need to type "sudo" or not; it's running as root so I don't think you need it but maybe try it with sudo in front of both "apt"s if it's not working. Also use whatever package manager you have if you aren't using apt)
while in the scripts folder you created earlier
nano os-updates.sh
save and don't forget to make it exectuable
then use
sudo crontab -e
(because you'll need root privileges to update. this will run the script as root without requiring you to input your password)I did think about cron but, long ago, I heard it wasn't best practice to update through cron because the lack of logs makes things difficult to see where things went wrong, when they do.
I've got automatic-upgrades running on stuff so it's mostly fine. Dockge is running purely to give me a way to upgrade docker images without having to ssh. It's just the monthly routine of "apt update && apt upgrade -y" *5 that sucks.
Thank you for the advice though. I'll probably set cron to update the images with the script as you suggest. I have a "maintenance" homarr page as a budget uptime kuma so I can quickly look there to make sure everything is pinging at least. I made the page so I can quickly get to everyone's dockge, pihole and nginx but the pings were a happy accident.
That's the best part, with a script, you can pipe the output of the updates into a log file you create yourself. I don't currently do that, if something breaks, I just roll back to a previous snapshot and try again later but it's possible and seemingly straight forward.
This askubuntu link will probably help
All good info. Thank you kindly.