this post was submitted on 20 Dec 2025
19 points (100.0% liked)

Linux

14449 readers
31 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

I've been generally running various different ways of backing up files to my NAS (which then backs up to other locations...) - mostly syncthing for photos and large collections of files, but I tend to use rsync to push out config backups to the NAS once something's working.

But, the NAS is only powered up a few times a day (to save on electricity costs), which is fine for manual pushes, but makes scheduling backups a bit tricky.

It dawned on me that it might be better for the NAS to pull the files via rsync instead of pushing them.

Anyone tried this route and have any advice?

top 14 comments
sorted by: hot top controversial new old
[–] possiblylinux127@lemmy.zip 1 points 1 hour ago

Definitely pull

You want your backup system to be isolated from the rest of the network.

[–] notabot@piefed.social 8 points 1 day ago (1 children)

The big difference between pull and push is which system has keys to access the other, and what an attacker could do with them. With your home network you might ultimately decide this isn't too important, but it's worth at least thinking about anyway.

In a push setup, each machine has some way (likely an SSH key) to authenticate to the NAS and push backup files to it. Each server has a different key to access a different path on the NAS, so if a server is compromised the attacker only gets access to that part of the NAS data, and if the NAS gets compromised, the attacker can't connect to anything but has access to the encrypted backups (you do encrypt the backups you care about, right?). This limits how much extra data the attacker can read, but has the downside you mentioned.

In a pull setup, the NAS has to have a way to connect to each server, typically as root for file access permissions. This means that if a server is compromised the attacker doesn't gain a way to access even a limited portion of the NAS, but if the NAS is compromised they gain access to keys to root access on every server, which is likely catastrophic.

A compromise solution can work. Have each server back up to a local file, then give the NAS permission to retrieve only that file, rather than root access. Whilst rsync isn't going to work for creating the single file backup, something like borg or restic would. This does mean you need more disk space on each server, but it also means that the server doesn't need direct access to the NAS, and the NAS only needs unpriviledged access to each server, mitigating the risk of a compromise.

[–] Cyber@feddit.uk 1 points 1 day ago

Hey, so good points there thst I hadn't considered at the time, I was only think of data... good point about the SSH keys, which is exactly what I would've done.

So, yeah, local backups on each device (kinda a good idea anyway) and then restricted pull from the NAS... nice...

[–] lepinkainen@lemmy.world 4 points 1 day ago (1 children)

The one that’s offline more often manages the schedule.

In my case the NAS is on 24/7 so the other machines push backups whenever they’re on.

In your situation the NAS is on randomly, so the NAS pulling backups will most likely work better

[–] Cyber@feddit.uk 1 points 1 day ago

Yes, that was my thoughts - or just have hourly backups where some will work, some won't...

Bit messy, but simple.

[–] nesc@lemmy.cafe 3 points 1 day ago (1 children)

Depends, in your case pull works. There is no universal answer here.

[–] Cyber@feddit.uk 2 points 1 day ago

True, I'm looking for the slap-the-forehead moments that others can save me from

[–] palordrolap@fedia.io 1 points 1 day ago

I still backup my files the most basic way, that is, create an archive locally, connect external storage and copy it there. Then disconnect external storage. The archive is made onto a separate internal drive and I keep the most recent one there, so I don't even need the external one for minor accidents.

I think only once in the last decade or so have I wanted (but never needed) to pull something back from external, but it's nice to know it's there.

The main downside to this method is that it doesn't de-duplicate, so keeping several takes a lot more space that it would do otherwise.

[–] drkt@scribe.disroot.org 1 points 1 day ago (1 children)

I have an LXC that pulls files to it as backups using rsync, and pushes backups to a remote location using borg.

Neither pushing nor pulling has any effect on the integrity of the backup, so just do which makes your life easier. I'm doing both because managing all of my backups from a single location is just easier.

[–] Cyber@feddit.uk 1 points 1 day ago (1 children)

So you're effectively using the LXC as a just a backup traffic coordinator?

Or, is that on a NAS also keeping a local copy?

[–] drkt@scribe.disroot.org 1 points 1 day ago

The LXC also has storage attached and houses backups, but it's not served in any accessible way. I just use SFTP if I need to pull some files. The off-site is for if I somehow destroy both my live copy and the backup copy.

[–] ryannathans@aussie.zone 0 points 1 day ago (1 children)

With syncthing, it doesn't matter. It just happens when they are both online

[–] moonpiedumplings@programming.dev 0 points 19 hours ago (1 children)

This is exactly why syncthing is problematic as a backup solution.

If I delete a file on one host and syncthing is doing the default two way sync, the deletion is also replicated to the other machine.

They acknowledge this in their faq: https://docs.syncthing.net/users/faq.html#is-syncthing-my-ideal-backup-application

You can mitigate some of these issues with file versioning, or one way syncs, but ultimately it's just not really the tool for the job.

[–] ryannathans@aussie.zone 1 points 18 hours ago

Okay so change the setting as you mentioned