Hi! A friend just recommended the backup tool that comes with Ubuntu. I took a look at it and was wondering what you guys include and exclude from the backups. I just installed wire guard VPN and but the config file in the etc/wireguard folder, where it belongs. I would have to include this folder as well if I want to keep my configs. And I guess many programs do the same, so how do you know what to include, so you can just revert to the last backup if something breaks or you get a new machine? Maybe that is a stupid question, but it was going through my head for some time now. Thanks a lot!

  • Tick Dracy@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    Hijacking this topic, I use this software on Windows, which do incremental backups of the system (including the OS, and documents, downloads, etc). It can also be easily restores by booting a custom image from an USB and restore the image.

    Is there anything like this with Linux?

  • lurch (he/him)@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    the most important thing is your user files. everything else just speeds up recovery.

    you should keep a bootable recovery medium around, like an installer USB, so you don’t have to bother your neighbours for one at 2 in the morning…

    to restore faster, you either make disk images (can restore everything quickly in one go) or save partiton layouts, configs and package selections as well as everything you installed without package management. if you don’t do this second part, you have to sit through a reinstall and figure out everything again and that sucks if you don’t have time. like you really need to open that document, but you forgot the name of the program you use to edit it etc…

    if you use just one large file system, you can tar everything up, using --one-file-system , so it skips stuff like the inside of mounted snap packages, which also are present in another place. on restore you then have to format untar and install a boot loader. beware that EFI boot can be difficult to set up and has another partition. so this is just for pros. however, this enables to use tar features like differential backups.

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        Yes but be careful with that option because it depends how it’s implemented by each tool. Some of them will not cross btrfs subvolumes for example.

  • Nia_The_Cat@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    I back up the entirety of my /home directory except for cache, temp, trash (trash is stored at /home/$user/.local/share/Trash), Download folder, and a folder I named “NOBACKUP”.

    It backs up a lot of stuff I probably don’t need, but I’d rather back up more than I need, than to be caught not backing up something that I did need.

    edit: oh, I have a btrfs snapshot of /root too

    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 months ago

      It’s best not to overuse native filesystem snapshots. Someone else was saying they delete them daily, that’s the right spirit.

      Filesystem snapshots can’t be dissociated from that filesystem and they are strictly incremental to the point they’re literally all-or-nothing which is quite inconvenient.

      They’re good for those “oh fuck” moments when you’ve just deleted the wrong dir but that’s about it.

  • cmnybo@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    I take a btrfs snapshot of my root partition daily so I can easily revert to an older version if I break something or get a bad update. There’s nothing on my desktop or laptop root partition that can’t be easily replaced, so I don’t bother with any backups apart from the snapshots.

    On my server, I keep multiple backups of /etc/ since there is a lot of stuff in there that I manually setup.

    If you just want to backup the configuration, you can backup the entire /etc/ directory, it will only take a few MB when compressed.

    • anarchoilluminati [comrade/them]@hexbear.net
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      7 months ago

      Do you know what you’d have to backup if you wanted to backup desktop settings, fonts, themes, app design customization, and so on? Would that be /etc/? I usually want to backup the desktop environment itself, if that makes sense, because I easily backup files (pictures, videos, and so on) already but I’m not sure how to backup the desktop itself and it’d take so much more time setting that up again so that’s actually my priority. Sounds like it would be /etc/ but just clarifying.

      I’m using PopOS.

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        You want to back up your home dir (/home/username) for that, specifically .config and .local dirs in there. But be aware that there are a lot of apps that circumvent that convention, for example Firefox uses .mozilla and so on. If you set your file manager to show hidden files you’ll see a lot of stuff in there, unfortunately.

  • PenguinCoder@beehaw.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    An OS can be restored. Backup your data, so /home for sure and maybe any custom configs for /etc, like your wireguard configs. So anything you specifically edited/added for /etc directory.

    • everett@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Skipping the OS backup is reasonable, but you probably want to at least save a package list. Add something like dpkg -l > ~/packages.txt to your backup script.

  • Avid Amoeba@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    If you want to be able to restore the machine completely, with everything installed and configured, then yes you have to backup everything. There’s generally two ways, file-level backup where you’d use something like rsync, tar, etc. and block-level where you’d backup the whole partition/disk using something like dd, clonezilla, etc. The latter is the easiest to restore but it’s a bit of a pain to backup because the system generally has to be offline, booted from alternative OS. The forner is a bit more difficult to restore but not by much, and it’s so easier to backup. You can do it while the system is live. I’d probably try that first. Find documentation on backing up a complete root filesystem with rsync/tar and you’re good to go. Some ideas. It’s typically a single command which can be run on a schedule.

    The built-in GUI backup tool is generally intended for your own user data. In order to be able to backup other things it’ll have to run as root or be given caps and that might get more complicated than using straight rsync/tar.

    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 months ago

      You can use Borg for both things you mentioned. It stores deduplicated chunks so it doesn’t care if you backup files or a block device.

      Not sure why you’d have to be offline to do that though.

    • WbrJr@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      What I am always wondering, to set up Linux until everything runs without problem, it takes quite some time for me. I use Linux for about a year regularly, and had to set it up about 4-5 times. And it almost always is a pain and I need to search online for some time until everything works. Is it getting easier the more often it’s done? Or do you create a setup script that runs everything if you reinstall the system?

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    My philosophy is “anything I can’t reproduce easily”. This will vary depending on the machine and data. But it’s been a good guide so far.

  • ChojinDSL@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    If you don’t know, or aren’t sure. Backup everything if you have the space. Once you’ve hit a couple of disaster scenarios, it will become apparent what stuff is really important.

    Obviously, the stuff you can’t recreate otherwise is most important. But apart from that, even the stuff you can recreate from other sources might be worth backing up because of time savings. E.g. faster to restore from backup than to recreate.

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Yup. Step 1 is backup everything. Step 2 is maybe improve your reproducibility and then remove the things that can be reproduced from the backups.

  • limelight79@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    Data and configurations.

    If you have the space, software is nice because it’s easier to get the system going again, but the data (your files - music, documents, pictures) and system configuration files (/etc for example) are the most critical. If you have databases set up, learn about their dump commands and add that.

    You don’t have to use the same method for everything. My pictures are backed up to another side in a second computer and to Amazon Glacier for $2/month (I’ll have to pay to download them if I ever need it, but I’ll gladly pay if I’m in that situation - those should only be needed if I have a major house fire or something like that). My weekly backups are my /home directories, /etc, /root, a database dump, and maybe one or two other important things.

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Really configuration is best not backed up but created from some source of truth like a Git repo. But a backup can serve as a poor-man’s version control.