Skip to content

Instantly share code, notes, and snippets.

@bradfa
Last active September 3, 2021 13:54
Show Gist options
  • Save bradfa/a710a4e4b83b07b7a8be77cae86ff56b to your computer and use it in GitHub Desktop.
Save bradfa/a710a4e4b83b07b7a8be77cae86ff56b to your computer and use it in GitHub Desktop.
Backups with bup

Exact Steps: Doing backups with bup to an external hard disk

Initial setup and first backup:

  1. Mount hard disk to /mnt/usb (you are strongly encouraged to use luks encryption on this disk!)
  2. mkdir /mnt/usb/.bup && bup init -r /mnt/usb/.bup to create and initialize a .bup directory on the USB disk. You may need to do some sudo and chmod/chgrp action depending on how your USB disk gets mounted. You'll save the actual files from backups here later.
  3. bup init to create the core bup repo in your home directory, the index will live here
  4. bup index ~/ to index your home directory
  5. bup index /etc to index your /etc directory
  6. bup save -n ${HOSTNAME}-etc -r /mnt/usb/.bup /etc to save the backup of your /etc directory to your USB disk. This backup set will result in a branch named after ${HOSTNAME}-etc, so that if you backup other PCs to this same .bup directory on your USB disk, you'll be able to see each one in a separate branch.
  7. bup save -n ${HOSTNAME}-home -r /mnt/usb/.bup ~/ to save the backup of your home directory to your USB disk. Similarly, your home directory will go in a ${HOSTNAME}-home branch.

To make a future incremental backup, mount your disk and start from step 4.

If you have more than one user on a given PC, you may want to backup the entire /home directory, or you may want to pick a more descriptive name for the backup branch which includes the username.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment