Difference between revisions of "Backups"

From Wiki | LUG@UCLA
Jump to: navigation, search
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Motivations ==
+
Computers fail, people make mistakes, environmental disasters happen. We recommend you back up your important data, as the initial setup is a small price to pay compared to data loss.
  
Computers fail, people make mistakes, environmental disasters happen. We recommend you back up your important data, as it is a small price to pay compared to data loss.
+
== Overview of techniques ==
  
== General techniques ==
+
'''Full copy backup'''—copy all files from the backup source to the backup destination. Subsequent full backups may cause files that already exist on the destination to be copied anyway. In many cases this method uses far more time and bandwidth resources than what is necessary.
  
=== Local backups ===
+
'''Incremental backup'''—copy only the files that changed since the previous backup. This method uses much less time, bandwidth, and energy resources than the full copy method. It is almost always the preferred method.
  
'''Full copy'''—this method is straightforward: copy all files from the backup source to the backup destination. Subsequent full backups may cause files that already exist on the destination to be copied anyway. In many cases this method uses far more time and bandwidth resources than what is necessary.
+
'''Remote (off-site) backup'''—don't put all your eggs in one basket! A remote backup will protect against environmental disasters, burglary, or any other scenario where local backups would fail.
  
'''Differential'''—
+
'''Encrypted backup'''—your files belong to you, and nobody else. Encryption incurs very little overhead in the backup process, so you have very little reason ''not'' to encrypt your backups. (for more information about encrypting email and other communications, see our [[Pretty Good Privacy|page on Pretty Good Privacy]])
  
'''Hybrid'''—
+
== Suggested workflow ==
  
=== Remote backups ===
+
=== Rsync (or luckyBackup) ===
 +
TODO
  
== Suggested workflow ==
+
=== duplicity (or Déjà Dup) ===
  
=== Rsync ===
+
[http://duplicity.nongnu.org/ Duplicity], or the more user-friendly [https://wiki.gnome.org/DejaDup/ Déjà Dup], combines tar, Gzip, Rsync, and GnuPG to create compressed, encrypted, versioned backups either locally or over the network. It is quick and efficient because it uses the ''incremental'' backup technique. It is quickly becoming the standard backup solution (as of June 2013) on user-friendly operating systems because it has a simple interface with a lot of features.
 +
 
 +
$ sudo apt-get install duplicity
 +
$ TODO...
 +
 
 +
$ sudo apt-get install deja-dup
 +
$ TODO...
 +
 
 +
=== rdiff-backup ===
 +
TODO
  
 
=== tar + Gzip (+ GnuPG) ===
 
=== tar + Gzip (+ GnuPG) ===
  
=== duplicity ===
+
Possibly the oldest, simplest, and most tested backup method is the ol' tarball method. This is an example of a ''full copy'' backup technique. Just archive your backup source into a .tar.gz (aka tarball) and encrypt it, if necessary. Here it is in one UNIX command:
duplicity, or it's user-friendly font-ends ''deja-dup'' and ''duply'', combines rsync, gzip, gpg, and a hybrid style backup for the ultimate backup solution.
+
 
 +
$ tar -czvf backup.tar.gz <strong><ins>backup/</ins></strong>
 +
 
 +
or, to use encryption:
 +
 
 +
$ tar -czvf - <strong><ins>backup/</ins></strong> | gpg --symmetric >backup.tar.gz.gpg
 +
 
 +
or, to use your LUG@UCLA account as the remote destination:
 +
 
 +
$ tar -czvf - <strong><ins>backup/</ins></strong> | gpg --symmetric | ssh <strong><ins>user</ins></strong>@linux.ucla.edu "cat >backup.tar.gz.gpg"
 +
 
 +
{{Note|if you're going to backup to the LUG server, please don't send more than 10 GB!}}
 +
 
 +
This method is not recommended for large and frequent backups.
  
 
== Relevant software ==
 
== Relevant software ==
Line 31: Line 54:
 
* [https://rsync.samba.org/ Rsync] - remote directory synchronizer
 
* [https://rsync.samba.org/ Rsync] - remote directory synchronizer
 
* [http://luckybackup.sourceforge.net/ luckyBackup] - GUI for Rsync (uses Rsync)
 
* [http://luckybackup.sourceforge.net/ luckyBackup] - GUI for Rsync (uses Rsync)
* [http://librsync.sourcefrog.net/doc/rdiff.html rdiff] - like [https://en.wikipedia.org/wiki/Diff diff], but designed better for binary files rather than source code
+
* [http://librsync.sourcefrog.net/doc/rdiff.html rdiff] - like [https://en.wikipedia.org/wiki/Diff diff], but better designed for binary files rather than source code
 
* [http://www.nongnu.org/rdiff-backup/ rdiff-backup] - remote incremental directory synchronizer (uses Rsync and rdiff)
 
* [http://www.nongnu.org/rdiff-backup/ rdiff-backup] - remote incremental directory synchronizer (uses Rsync and rdiff)
 
* [http://duplicity.nongnu.org/ duplicity] - remote versioned encrypted backup (uses tar, GnuPG, Rsync, and rdiff)
 
* [http://duplicity.nongnu.org/ duplicity] - remote versioned encrypted backup (uses tar, GnuPG, Rsync, and rdiff)
 
* [https://wiki.gnome.org/DejaDup/ Déjà Dup] - GUI for duplicity (uses duplicity)
 
* [https://wiki.gnome.org/DejaDup/ Déjà Dup] - GUI for duplicity (uses duplicity)
 
* [http://www.rsnapshot.org/ rsnapshot] - remote versioned backup (uses Rsync and UNIX hard links)
 
* [http://www.rsnapshot.org/ rsnapshot] - remote versioned backup (uses Rsync and UNIX hard links)
 +
 +
== Links ==
 +
 +
* [https://help.ubuntu.com/community/BackupYourSystem BackupYourSystem - Ubuntu documentation]
 +
* [http://www.reddit.com/r/linux/comments/1hds0h/what_remote_backup_toolstrategy_do_you_use/ What (remote) backup tool/strategy do you use? - Reddit]

Latest revision as of 15:44, 23 November 2013

Computers fail, people make mistakes, environmental disasters happen. We recommend you back up your important data, as the initial setup is a small price to pay compared to data loss.

Overview of techniques[edit]

Full copy backup—copy all files from the backup source to the backup destination. Subsequent full backups may cause files that already exist on the destination to be copied anyway. In many cases this method uses far more time and bandwidth resources than what is necessary.

Incremental backup—copy only the files that changed since the previous backup. This method uses much less time, bandwidth, and energy resources than the full copy method. It is almost always the preferred method.

Remote (off-site) backup—don't put all your eggs in one basket! A remote backup will protect against environmental disasters, burglary, or any other scenario where local backups would fail.

Encrypted backup—your files belong to you, and nobody else. Encryption incurs very little overhead in the backup process, so you have very little reason not to encrypt your backups. (for more information about encrypting email and other communications, see our page on Pretty Good Privacy)

Suggested workflow[edit]

Rsync (or luckyBackup)[edit]

TODO

duplicity (or Déjà Dup)[edit]

Duplicity, or the more user-friendly Déjà Dup, combines tar, Gzip, Rsync, and GnuPG to create compressed, encrypted, versioned backups either locally or over the network. It is quick and efficient because it uses the incremental backup technique. It is quickly becoming the standard backup solution (as of June 2013) on user-friendly operating systems because it has a simple interface with a lot of features.

$ sudo apt-get install duplicity
$ TODO...
$ sudo apt-get install deja-dup
$ TODO...

rdiff-backup[edit]

TODO

tar + Gzip (+ GnuPG)[edit]

Possibly the oldest, simplest, and most tested backup method is the ol' tarball method. This is an example of a full copy backup technique. Just archive your backup source into a .tar.gz (aka tarball) and encrypt it, if necessary. Here it is in one UNIX command:

$ tar -czvf backup.tar.gz backup/

or, to use encryption:

$ tar -czvf - backup/ | gpg --symmetric >backup.tar.gz.gpg

or, to use your LUG@UCLA account as the remote destination:

$ tar -czvf - backup/ | gpg --symmetric | ssh user@linux.ucla.edu "cat >backup.tar.gz.gpg"

Note Note: if you're going to backup to the LUG server, please don't send more than 10 GB!

This method is not recommended for large and frequent backups.

Relevant software[edit]

  • Gzip - compression utility
  • tar - file archiver
  • GnuPG - encryption utility
  • Rsync - remote directory synchronizer
  • luckyBackup - GUI for Rsync (uses Rsync)
  • rdiff - like diff, but better designed for binary files rather than source code
  • rdiff-backup - remote incremental directory synchronizer (uses Rsync and rdiff)
  • duplicity - remote versioned encrypted backup (uses tar, GnuPG, Rsync, and rdiff)
  • Déjà Dup - GUI for duplicity (uses duplicity)
  • rsnapshot - remote versioned backup (uses Rsync and UNIX hard links)

Links[edit]