What is it?
Backup is a highly flexible script written in
Perl used for the
fast backup
of directories on your local system on various targets such as an
external drive, an [encrypted] sparsebundle or a remote machine with SSH or AFP access.
Backup is designed to be run by command-line and rely on
Perl,
rsync
(meaning only the files that differs are transfered) and (in a future release)
Duplicity together with a configuration file.
And more precisely?
As always, a concrete situation with a precise example is the best to apprehend the behaviour of a new tool.
Assume therefore that you want to backup all directories in your homedir:
- (default backup) on an external drive mounted in
/Volumes/Backup
- (for MAC OS X user) on a local
[encrypted] sparse bundle image
/path/to/image.sparsebundle
- on your desktop machine (
toto.example.org
) where
you have an SSH access (username: mylogin
) with
public-key authentication
- (for MAC OS X user) on your company NAS (Network-attached Storage)
nas.company.com
where you own a volume (name: volname
) configured for AFP (Apple Filing Protocol)
access (login: mylogin
, password: mypassword
).
Note that this applies to a backup on Apple Time Capsule.
- (NEW) on a remote [encrypted] sparse bundle image on your company NAS (using the volume attributed
to you as stated in the previous item) ;)
The last three backup should interviene only when you're working.
This state is typically identified by your IP subnet (Let's say 10.7.14 for instance).
This behaviour is represented through the following configuration file of
Backup:
#
# Configuration file example for backup(3)
#
#### Mandatory global settings ####
<global>
src_rootdir = $HOME # Root directory on the (local) source
include_dir = * # backup all sub-directories (relative to src_rootdir)
</global>
#### Mandatory default backup definition ####
<default>
target_url = drive:///Volume/Backup # backup on an external drive 'Backup'
</default>
# Definition of the backup on a local [encrypted] sparse bundle
<sbimage>
target_url = sparsebundle:///path/to/image.sparsebundle
dst_rootdir = myBackup # Root directory for the backup
</sbimage>
# Definition of the backup on the machine 'toto' (via SSH access)
<toto>
target_url = ssh://mylogin@toto.example.org # backup through ssh
dst_rootdir = /backup/`whoami`@`hostname` # Root directory on target server
restrict_on_subnet = 10.7.14 # backup only when you're working
</toto>
# Definition of the backup on the company NAS (via AFP access)
<nas>
target_url = afp://mylogin:mypassword@nas.company.com/volname
dst_rootdir = myBackup # Root directory for the backup
restrict_on_subnet = 10.7.14 # backup only when you're working
</nas>
# Definition of the backup on a remote [encrypted] sparse bundle on the company NAS
<nassbimage>
target_url = afp://mylogin:mypassword@nas.company.com/volname/path/to/image.sparsebundle
dst_rootdir = myBackup # Root directory for the backup
restrict_on_subnet = 10.7.14 # backup only when you're working
</nassbimage>
Pretty natural I hope :)
To backup using the default configuration, just run:
backup
To backup using the '
toto
' section of the configuration file,
just run:
backup --section=toto
If you need to restore data from the backup '
toto
', run :
backup --section=toto -r
Current development status
Backup is still in Alpha (last version: 0.3.2) and not all functionnality
are supported (most importantly
Duplicity).
Anyway it is sufficient if you plan to backup your data on a external drive or a
remote server (via SSH or AFP). That's typically my daily usage of this script.
Currently
Backup supports deleted files, full unix permissions, directories,
and symbolic links.
As for protocols connecting to a backup target,
Backup supports local sockets
(for local file/directories access), Mac OS X sparse bundle images,
ssh
and
afp
.
Licence
Backup is released under
GNU GPL Licence v3 (free software).
Authors
Most of
Backup was made by
Sebastien Varrette.
I'm grateful to
Guillaume-Jean Herbiet who joined force recently to improve
the script in many ways (sparsebundle support, notification etc.)