Can you please share your backup strategies for linux? I’m curious to know what tools you use and why?How do you automate/schedule backups? Which files/folders you back up? What is your prefered hardware/cloud storage and how do you manage storage space?

  • Peasley@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    4 days ago

    I built a backup server out of my old desktop, running Ubuntu and ZFS

    I have a dataset for each of my computers and i back them up to the corresponding datasets in the zfs pool on the server semi-regularly. The zfs pool has enough disks for some redundancy, so i can handle occasional drive failures. My other computers run arbitrary filesystems (ext4, btrfs, rarely ntfs)

    the only problem with my current setup is that if there is file degradation on my workstation that i dont notice, it might get backed up to the server by mistake. then a degraded file might overwrite a non-degraded backup. to avoid this, i generally dont overwrite files when i backup. since 90% of my data is pictures, it’s not a big deal since they dont change

    Someday i’d like to set up proxmox and virtualize everything, and i’d also like to set up something offsite i could zfs-send to as a second backup

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    6 days ago

    Shout out to all the homies with nothing, I’m still waiting to buy a larger disk in hopes of rescuing as much data from a failing 3TB disk as I can. I got some read errors and unplugged it about 3 months ago.

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    7 days ago

    I was talking with a techhead from the 80s about what he did when his tape drives failed and the folly that is keeping data alive on a system that doesn’t need to be. His foolproof backup storage is as follows.

    1. At Christmas buy a new hard drive. If Moore’s law allows, it should be double what you currently have
    2. Put your current backup hardrive into a SATA drive slot. Copy over backup into new hard drive.
    3. Write with a sharpie the date at which this was done on the harddrive. The new hard drive is your current backup.
    4. Place the now old backup into your drawer and forget about it.
    5. On New Years Day, load each of the drives into a SATA drive slot and fix any filesystem issues.
    6. Put them back into the drawer. Go to step 1.
  • squid_slime@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    7 days ago

    Dot files on github, an HHD for storing photos, downloads, documents as well as my not in use games. I also sync keepass files across all network devices.

  • Earth Walker@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    edit-2
    8 days ago

    I use Borg Backup, automated with a bash script that Borg provides. A cron job runs the script at the desired frequency. I keep backups on different computers, ideally I would recommend one copy in the cloud and one copy on a local machine. Borg compresses and encrypts its backups.

    Edit: I migrated a server once using the backups from this system and it worked great.

  • astrsk@fedia.io
    link
    fedilink
    arrow-up
    27
    ·
    8 days ago

    Borg backup is gold standard, with Vorta as a very nice GUI on machines that need it. Otherwise, all my other Linux machines are running in proxmox hypervisors and have container/snapshot/vm backups regularly through proxmox backup server to another machine. All the backup data is then replicated regularly, remotely via truenas scale replication tasks.

    • GenderNeutralBro@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      6
      ·
      8 days ago

      Borg via Vorta handles the hard parts: encryption, compression, deduplication, and archiving. You can mount backup snapshots like drives, without needing to expand them. It splits archives into small chunks so you can easily upload them to your cloud service of choice.

    • NotAnArdvark@lemmy.ca
      link
      fedilink
      arrow-up
      5
      ·
      7 days ago

      Adding my “Me too” to Vorta/Borg. I use it with Borgbase, which I like because it’s legitimately cheap and they support Borg development. As well, you can set Borg backups with Borgbase to “append only,” which prevents ransomware or other unexpected “whoopsies” from wiping out your backup history.

      I backup most of my computer every hour, but have pruning rules that make sure things don’t get too out of hand. I have a second backup that backs everything up to my NAS (using Vorta, again). This is helpful for things like my downloads folder, virtual machines, or STEAM library - things I wouldn’t want to backup over the network, but on occasion I do find myself going “whoops, I wanted that.”

      I also have Vorta working on my Mom’s Macbook, then have Borgbase send me an email when there isn’t any activity for longer than a couple of days. Once I got automatic pruning working right I never had to touch this again.

  • TimeSquirrel@kbin.melroy.org
    link
    fedilink
    arrow-up
    15
    ·
    8 days ago

    I plug in an external drive every so often and drag and drop parts of my home dir into it like it’s 1997. I’m not running a data center here. The boomer method is good enough and I don’t do anything important enough to warrant going all out with professional snapshot based backup solutions and stuff. And I only save personal documents, media, and custom config files. Everything else is replaceable.

    • Papamousse@beehaw.org
      link
      fedilink
      arrow-up
      4
      ·
      8 days ago

      yeah about the same, old coot here, I plug a USB3-SSD (encrypted with LUKS) and rsync from internal HD to this external HD. That’s it.

    • Fonzie!@ttrpg.network
      link
      fedilink
      arrow-up
      2
      ·
      7 days ago

      I do exactly this but with a little shell script that just has some rsync -av and mv -f calls instead of dragging and dropping.

  • shapis@lemmy.ml
    link
    fedilink
    arrow-up
    14
    ·
    7 days ago

    All my code and projects are on GitHub/codeberg.

    All my personal info and photos are on proton drive.

    If Linux shits itself (and it does often) who cares. I can have it up and running again in a fresh install in ten minutes.

    • krash@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      But proton drive soaent have a linux client yet, I suppose you just upload your files there once through the web interface and don’t sync?

      • shapis@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        6 days ago

        Personal stuff is mostly on my phone. And I’ll just sync to the computer what’s needed.

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    13
    ·
    8 days ago

    I use rsync to incrementally back up / to a separate drive, as well as a drive on another device (my server), which then packs, compresses and encrypts the latest backup of all devices daily, and uploads them to Hetzner as well as GDrive.

  • Kongar@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    8 days ago

    Synology NAS. I really love that thing. I use their synology drive software to backup the Linux home folder, as well as windows PCs, iPads, iPhones etc. I use their photos mobile software to automatically backup phone photos and videos. I also synchronize a few select folders between PCs so certain in-use files are always up to date. I set the NAS to keep 30 old versions of every file. This works great for my college kids - dad has a copy of everything in case they nuke a paper or something (which has happened).

    I stopped cloning drives long ago. Now I just reinstall the os and packages. With Linux, this is honestly faster than deploying a backup - a single pacman command installs everything I want. Then I just log into things as I open them. Ya I might have to futz around with some settings or redownload some big games on steam - but the eye candy and games can wait - I can be productive pretty quickly after an install.

    I DO use btrfs with automatic snapshots (snapper and btrfs assistant). This saves me from myself when I bork an update (which I’ve done more than once). If I make a mistake, I just rollback a snapshot, and try again without my stupid mistakes. This has saved my install 3 or 4 times now.

    Lastly, I sneaker net an external hard drive to my office. On it is a manual backup of the NAS. I do this once per month. This protects from catastrophic failures like my house burning down. I might lose a month or so of pictures in the worst case scenario, but I still have my 25+ years of pictures of my kids, wedding videos, etc.

    In the end, the only thing that really matters is not losing my lifetime of family pictures and the good memories they provoke.

    • ddh@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 days ago

      Synology NAS here also, divided into private (family stuff, docker volumes etc) and public (Linux ISOs and anything that can be redownloaded). Both get backed up weekly to an older NAS with Hyper Backup. Private additionally goes onto a LUKS encrypted drive monthly which is spot-checked, taken offsite, and the previous offsite drive brought back. I don’t back up any PC (don’t care, just reinstall) or phones (they are backed up on iCloud).

  • digdilem@lemmy.ml
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    8 days ago

    Scuse the cut and paste, but this is something I recently thought quite hard about and blogged, so stealing my own content:

    What to back up? This is a core question to ask when you start planning. I think it’s quite simply answered by asking the secondary question: “Can I get the data again?” Don’t back up stuff you downloaded from the public internet unless it’s particularly rare. No TV, no Movies, no software installers. Don’t hoard data you can replace. Do back up stuff you’ve personally created and that doesn’t exist elsewhere, or stuff that would cause you a lot of effort or upset if it wasn’t available. Letters you’ve written, pictures you’ve taken, code you authored, configurations and systems that took you a lot of time to set up and fine tune.

    If you want to be able to restore a full system, that’s something else and generally dealt best with imaging – I’m talking about individual file backups here!

    Backup Scenario Multiple household computers. Home linux servers. Many services running natively and in docker. A couple of windows computers.

    Daily backups Once a day, automate backups of your important files.

    On my linux machines, that’s things like some directories like /etc, /root, /docker-data, some shared files.

    On my windows machines, then that’s some mapping data, word documents, pictures, geocaching files, generated backups and so on.

    You work out the files and get an idea of how much space you need to set aside.

    Then, with automated methods, have these files copied or zipped up to a common directory on an always-available server. Let’s call that /backup.

    These should be versioned, so that older ones get expired automatically. You can do that with bash scripts, or automated backup software (I use backup-manager for local machines, and backuppc or robocopy for windows ones)

    How many copies you keep depends on your preferences – 3 is a sound number, but choose what you want and what disk space you have. More than 1 is a good idea since you may not notice the next day if something is missing or broken.

    Monthly Backups – Make them Offline if possible

    I puzzled a long time over the best way to do offline backups. For years I would manually copy the contents of /backup to large HDDs once a month. That took an hour or two for a few terabytes.

    Now, I attach an external USB hard drive to my server, with a smart power socket controlled by Home Assistant.

    This means it’s “cold storage”. The computer can’t access it unless the switch is turned on – something no ransomware knows about. But I can write a script that turns on the power, waits a minute for it to spin up, then mounts the drive and copies the data. When it’s finished, it’ll then unmount the drive and turn off the switch, and lastly, email me to say “Oi, change the drives, human”.

    Once I get that email, I open my safe (fireproof and in a different physical building) and take out the oldest of three usb Caddies. Swap that with the one on the server and put that away. Classic Grandfather/Father/Son backups.

    Once a year, I change the oldest of those caddies to “Annual backup, 2024” and buy a new one. That way no monthly drive will be older than three years, and I have a (probably still viable) backup by year.

    BTW – I use USB3 HDD caddies (and do test for speed – they vary hugely) because I keep a fair bit of data. But you can also use one of the large capacity USB Thumbdrives or MicroSD cards for this. It doesn’t really matter how slowly it writes, since you’ll be asleep when it’s backing up. But you do really want it to be reasonably fast to read data from, and also large enough for your data – the above system gets considerably less simple if you need multiple disks.

    Error Check: Of course with automated systems, you need additional automated systems to ensure they’re working! When you complete a backup, touch a file to give you a timestamp of when it was done – online and offline. I find using “tree” to catalogue the files is worthwhile too, so you know what’s on there.

    Lastly – test your backups. Once or twice a year, pick a backup at random and ensure you can copy and unpack the files. Ensure they are what you expect and free from errors.

  • _spiffy@lemmy.ca
    link
    fedilink
    English
    arrow-up
    7
    ·
    7 days ago

    Dump configs to backup drive. Pray to the machine spirit that things don’t blow up. Only update when I remember. I’m a terrible admin for my own stuff.