from Hacker News

Ask HN: Linux Machine Periodic Backup

by golanggeek on 4/19/20, 8:35 AM with 6 comments

I have been using MacOS for a long time and have always had a peace of mind using the Time Machine backup.

Just now migrated to a Linux machine - and I was wondering what would be the available options for Linux Backup. Found

1. https://www.duplicati.com/

2. Plain old rsync

Any comments on these and/or any other programs/methods you use.

  • by tikej on 4/19/20, 3:14 PM

    Borg: https://www.borgbackup.org is my goto choice both for Mac and Linux. I combine it with syncthing (which is not a backup solution but improves data redundancy for my most important and used files) to sync between laptop and desktop.

    The only lacking thing is backing up full state of the machine but for that purpose I will probably move to guix or nix. Unfortunately it is a lot of work and I didn't started it yet.

  • by Risse on 4/19/20, 9:25 AM

    Most of the files that I need daily are in Nextcloud. The client for Linux is decent, have had no issues.

    I also have a separate backup folder, that is too big for Nextcloud, but that I want to backup from time to time. Those files are copied to a FTP server using rclone. I just have this line in crontab, so that it backs them up weekly.

    0 4 * * 1 rclone copy /folder-to-backups backups-config

  • by simonblack on 4/19/20, 11:49 PM

    I back up my /home and system partitions daily. I back up my long-term archive partitions daily.

    /home partition: Straight-out cpio backup in full (around 9-10 gigs). The /home partition is restricted to work-in-progress directories and personal documents. I break that large cpio file into 2000MB chunks so that they can be transferred on any USB thumb-drive.

    There is no need to hold anything else in the /home partition. Anything you keep 'for later' goes straight to an archive partition.(Photos, music, videos, software, ebooks,etc.)

    Archive directories/partition(s): plain old rsync. The first time you do this, it will take hours. Subsequent rsync backups take only a few minutes for (say) 8TB of archives because you make very few changes to an archive partition on a daily basis.

    System partition: This is where you get sneaky. Only backup the important information, such as:

      The /etc directory which holds all of your configuration stuff for your apps.
    
      A list of the installed software packages.
    
      mysql databases.
    
      crontabs, .bashrc files.
    
      website.
    
      /usr/local directory.
    
      EFI boot partition.
    
    The thing with the system backup is that you only keep the stuff that will allow you to completely rebuild the system in the case of a disaster. You can re-install the distro and then rebuild the system to your specifications in less than two hours if need be. That is only about 2-3 gigs of backup space rather than (say) 20 gigs.

    Here is the 'ls' and 'du' output of my last night's non-archive backup. Total 12 gigs. 'centrepoint' is the machine's name.

        [jvs] /x/BAK/2858-200420 > ls
        
        apache2_valid_200316.tgz        jvs.centrepoint.200420.cpio-d   partition_tables.centrepoint.200420
        backup.time.centrepoint.200420  jvs.centrepoint.200420.cpio-e   root_bashrc.centrepoint.200420
        debian.pkgs.centrepoint.200420  jvs_crontab.centrepoint.200420  root_crontab.centrepoint.200420
        etc.centrepoint.200420.cpio     letsencrypt_valid_200316.tgz    sda2-EFI.centrepoint.200420.img
        git.200420.cpio                 Linux_Mint_19.3_Tricia          uname-a.centrepoint.200420
        jvs.centrepoint.200420.cpio-a   local.centrepoint.200420.cpio   www.centrepoint.200420.cpio
        jvs.centrepoint.200420.cpio-b   mysql.centrepoint.200420.sql
        jvs.centrepoint.200420.cpio-c   new-system-etc-copy
        
        [jvs] /x/BAK/2858-200420 > du -hs .
        12G     .
  • by brikwilliams on 4/19/20, 9:02 PM

    I use Timeshift (https://github.com/teejee2008/timeshift), and find it to be worry/hassle free.
  • by ghastmaster on 4/21/20, 6:20 PM

  • by zzo38computer on 4/19/20, 10:17 PM

    I use compressed tape archives recorded on DVDs.