Editing User:Nomaster/Backup

From Chaosdorf Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
This article is a couple of years old and I have already moved all of my precious data into the cloud. Because the flying spaghetti monster will save us all. Not.
...but I am still convinced this may be helpful to you.
<blockquote>
<blockquote>
Jesus saves. Buddha does incremental backups.
Jesus saves. Buddha does incremental backups.
Line 37: Line 33:
   cryptsetup luksOpen /dev/sdb backup
   cryptsetup luksOpen /dev/sdb backup


If not happened yet, format the drive with a [[Wikipedia:Btrfs|btrfs]] filesystem
Inside, there is [[Wikipedia:Btrfs|btrfs]] filesystem, I mount using compression.
 
  mkfs.btrfs -L backup /dev/mapper/backup
 
Then, mount it and use compression
 
  mount -o compress=lzo -t btrfs LABEL=backup /media/backup
 
If not happened yet, create a subvolume


   btrfs subvolume create /media/backup/nomaster
   mount -o compress -t btrfs /dev/sdb /mnt/backup


For may backups, I use rsync (with delete) to copy my files to an external hard drive. Vanished files will be deleted.
For may backups, I use rsync (with delete) to copy my files to an external hard drive. Vanished files will be deleted.
    
    
   rsync -aPv --delete --exclude downloads --exclude music --exclude .cache /home/nomaster/ /media/backup/nomaster/
   rsync -aPv --delete --exclude downloads --exclude music --exclude .cache /home/nomaster/ /mnt/backup/nomaster/


After each sync, I make a snapshot of this state of my files.
After each sync, I make a snapshot of this state of my files.


   sudo btrfs subvolume snapshot -r /media/backup/nomaster /media/backup/nomaster-$(date +%F)
   sudo btrfs subvolume snapshot /mnt/backup/nomaster /mnt/backup/nomaster120331


Lastly, I unmount the filesystem and close the container.
Lastly, I unmount the filesystem and close the container.


   sudo umount /media
   sudo umount /mnt
   sudo cryptsetup luksClose backup
   sudo cryptsetup luksClose backup


Please note that all contributions to Chaosdorf Wiki are considered to be released under the Attribution 3.0 Unported (see Chaosdorf Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)