I want to create a backup of my Linux system, including user files, from the command line. I tried using Timeshift but it doesn’t have a CLI argument to include a folder.

I found a guide on dev.to that explains how to use Timeshift from the command line, but it doesn’t mention how to include user files. According to ItsFOSS, Timeshift is designed to protect system files and settings, not user data, so user home directories are excluded by default.

I came across a list of backup programs for Linux on Slant, and BackInTime appears to be the best.

Has anyone used BackInTime to backup the whole system including user files? Are there any other tools that you would recommend?

Edit: would also be nice if it had similar features to Timeshift, like incremental snapshots, weekly snapshots, list, restore and delete snapshots, etc.

  • Maoo [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    4
    ·
    11 months ago

    If it’s a desktop/laptop, I recommend Pika, which is just a nice frontend and scheduler for borg backup. If it’s a server, I recommend borgmatic.

    The nice thing about borg is that it does all of the things people usually want from backups but that are kind of frustrating to do with scripts:

    • Encryption so they’re private and can be uploaded to cloud storage safely.
    • Compression so they aren’t too big.
    • Uses snapshots with deduplication so that they don’t take up too much space.
    • Snapshots happen on a schedule.
    • There’s a retention policy of how many snapshots to keep and at what interval (1 snapshot per year for the last 4 years and 1 per month for 12 months, for example).
    • You can browse through old snapshots to retrieve files.
    • You can restore from a snapshot.
    • Ignore certain files, directories, and patterns.

    It is surprisingly difficult to get all of that in one solution, but borg things will do all of the above.