this post was submitted on 31 Jul 2024
23 points (96.0% liked)

Selfhosted

39167 readers
382 users here now

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:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

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

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I have a proxmox+Debian+docker server and I'm looking to setup my backups so that they get backed up (DUH) on my Linux PC whenever it comes online on the local network.

I'm not sure if what's best is backing up locally and having something else handling the copying, how to have those backup run only if they haven't run in a while regardless of the availability of the PC, if it's best to have the PC run the logic or to keep the control over it on the server.

Mostly I don't want to waste space on my server because it's limited...

I don't know the what and I don't know the how, currently, any input is appreciated.

you are viewing a single comment's thread
view the rest of the comments
[–] tvcvt@lemmy.ml 1 points 1 month ago

Since you're interested in this kind of DIY, approach, I'd seriously consider thinking the whole process through and writing a simple script for this that runs from your desktop. That will make it trivial to do an automatic backup whenever you're active on the network.

Instead of cron, look into systemd timers and you can fire off your script after, say, one minute of being on your desktop, using a monotonic timer like OnUnitActiveSec=60.

Thinking through the script in pseudo code, it could look something like:

rsync -avzh $server_source $desktop_destination || curl -d "Backup failed" ntfy.sh/mytopic

This would pull the back from your server to your desktop and, if the backup failed, use a service such as ntfy.sh to notify you of the problem.

I think that would pretty much take care of all of your requirements and if you ever decided to switch systems (like using zfs send/recv instead of rsync), it would be a matter of just altering that one script.