Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

rgrove/crackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crackup

Crackup is a pretty simple, pretty secure remote backup solution for folks who want to keep their data securely backed up but aren’t particularly concerned about bandwidth usage.

Crackup is ideal for backing up lots of small files, but somewhat less ideal for backing up large files, since any change to a file means the entire file must be transferred. If you need something bandwidth-efficient, try Duplicity.

Backups are compressed and (optionally) encrypted via GnuPG and can be transferred to the remote location over a variety of protocols, including FTP. Additional storage drivers can easily be written in Ruby.

Note: Crackup is no longer actively maintained. Feel free to use it and modify it to meet your needs, but please don’t expect support.

Requirements

  • Ruby 1.8.4+
  • GnuPG 1.4.2+ (if you want to encrypt your backups)

Download/Install

The latest version of Crackup is available via RubyGems:

gem install crackup

Usage

crackup

crackup -t <url> [-p <pass>] [-x <file>] [-v] [<file|dir> ...]

  -p, --passphrase <pass>  Encryption passphrase (if not specified, no
                           encryption will be used)
  -t, --to <url>           Destination URL (e.g.,
                           ftp://user:pass@server.com/path)
  -v, --verbose            Verbose output
  -x, --exclude <file>     Exclude files and directories whose names match the
                           list in the specified file
  -h, --help               Display usage information (this message)
      --version            Display version information

crackup-restore

crackup-restore -f <url> -t <path> [-p <pass>] [-v] [<file|dir> ...]
crackup-restore -f <url> -l [-p <pass>] [-v]

  -f, --from <url>         Remote URL to restore from (e.g.,
                           ftp://user:pass@server.com/path)
  -l, --list               List all files at the remote location
  -p, --passphrase <pass>  Encryption passphrase (if not specified, no
                           encryption will be used)
  -t, --to <path>          Destination root directory for the restored files
  -v, --verbose            Verbose output
  -h, --help               Display usage information (this message)
      --version            Display version information

Examples

crackup

Create or update a local backup of your home directory

crackup -t /backups/home ~/

Create or update an encrypted FTP backup of your home directory

crackup -t ftp://user:pass@example.com/backups/home -p passphrase ~/

Create or update a backup of several directories and files to an SMB share

crackup -t //smbhost/backups/example /etc /usr/local/etc ~/*.rb

crackup-restore

Restore a local backup to your home directory

crackup-restore -f /backups/home -t ~/

Restore an encrypted FTP backup to a temporary directory

crackup-restore -f ftp://user:pass@example.com/backups/home -t /tmp/restore -p passphrase

Restore only the /etc and /usr/local/etc directories from an SMB backup to a temporary directory

crackup-restore -f //smbhost/backups/example -t /tmp/restore /etc /usr/local/etc

Restore only *.rb files from an SMB backup to a temporary directory

crackup-restore -f //smbhost/backups/example -t /tmp/restore *.rb

Display a list of all files and directories contained in the specified local backup

crackup-restore -f /backups/home -l

FAQ

How secure is Crackup?

Pretty secure if you provide a passphrase; not at all secure if you don’t. If you provide a passphrase when creating a backup, Crackup uses GnuPG to encrypt both the file index and all the files themselves using a 256-bit AES cipher before transferring them to the remote location.

At the remote location, Crackup stores the encrypted index as a .crackup_index file and stores each backed up file as a bzip2-compressed and encrypted crackup_<hash> file, where <hash> is an SHA256 hash of the file’s original path. While this structure doesn’t reveal actual filenames or directory structures, it does reveal the total number of files backed up, as well as the size of each file after compression and encryption.

Crackup assumes that the local system (the one you’re backing up from) is secure, and that the remote system (the one you’re backing up to) is not. Operations on the local machine may store information such as filenames and passphrases in unsecure memory; in particular, the passphrase is passed to GnuPG via a pipe in a system call (and is provided to Crackup itself as a command-line parameter), so it may end up in cleartext in your shell history or a system log file.

How reliable is Crackup?

Pretty reliable, but not bulletproof. Crackup is intended to provide a very simple means of backing up and restoring small to medium-sized files with a minimum of effort. I make every effort to ensure that Crackup is as bug-free as possible, but there’s always a chance that I made a horrible mistake somewhere or failed to anticipate something that could result in data loss.

In short, if losing your files would endanger someone’s life, cost you money, or get you fired, you should probably back them up with something other than Crackup. On the other hand, if losing your files would just make you sad and be an inconvenience, Crackup is probably a safe choice.

How bandwidth-efficient is Crackup?

It’s not a hog, but it’s not as efficient as rsync. When backing up or restoring a file, Crackup must transfer the entire file to or from the remote location, even if only a tiny portion of the file has changed. In this respect, Crackup is less efficient than rsync, which is able to save bandwidth by transferring only the differences between local and remote files (at the expense of requiring you to be able to run an instance of rsync on the remote machine).

In addition, Crackup stores its file index at the remote location, so the entire index must be downloaded at the beginning of any backup or restore session and then (in the case of a backup that results in changes) uploaded again at the end of the session. The index format is fairly compact (especially when compressed), but this will still result in slightly more bandwidth usage than some other backup tools.

Is it possible to restore backups without crackup-restore?

Yes, although it might be a little tedious unless you write a script to help you. The .crackup_index file stored at the remote location is simply a Hash of Ruby objects serialized to disk via Ruby’s Marshal library. The binary format used by Marshal is described at the RubySpec wiki.

If encryption is used, all files at the remote location (including the index) are compressed using bzip2 compression and encrypted using GnuPG. GnuPG can uncompress and decrypt them if the proper passphrase is provided. If encryption is not used, the files (including the index) are compressed using gzip compression and can be uncompressed using the gunzip utility or any other decompression utility that supports gzip.

Once the index file is uncompressed (and decrypted, if necessary), you can manipulate it using a simple Ruby program and the Crackup library:

#!/usr/bin/env ruby
require 'crackup'

# Load the Crackup index file.
index = File.open('.crackup_index', 'rb') {|file| Marshal.load(file) }

# Print the names of the files and directories in the index.
puts Crackup::get_list(index)

# Restore everything to the /tmp/restore directory.
index.each_value {|item| item.restore('/tmp/restore') }

Consult the RDoc documentation installed with the Crackup gem for details on the Crackup library’s API.

If you don’t have Ruby or if you’ve somehow lost your copy of Crackup, can’t download it again for some reason, and therefore can’t read the index file, you can still restore the contents of your files by decrypting them or decompressing them manually. Unfortunately, without the index, you won’t be able to restore the actual pathnames of any of the files.

Where did the name “Crackup” come from?

It originally stood for “Crappy Remote Backup”, but by the time Crackup was released, it wasn’t very crappy anymore, so the C doesn’t really mean anything now. Feel free to make something up.

Does Crackup work in Windows?

Yep. You can even use Windows-style paths with drive letters, backslashes, etc. Windows-style UNC paths will work as well.

Copyright

Copyright © 2006 Ryan Grove. All rights reserved.
Crackup is free open source software distributed under the terms of the New BSD License.

About

💀 Crappy remote backup. Unmaintained.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages