Useful Backups using python.
Posted in computers on April 10th, 2011 by Quilib – Be the first to commentI came across a great backup method which can be accomplished by using python and the information is worth its weight in gold. If your a Linux user and worried about your backups a good simple solution which will work over any network nas inclusive is written below.
# Optional, log all events
LOG_FILE /home/quilib/logs/backup.log
# Optional, we try to mount this path first. Failures halt execution.
PRE_MOUNT /mnt/backup/
# Required, password and mount point for encrypted/decrypted file
# systems. The password can be in plaintext since this file is stored
# on an encrypted filesystem anyway. We aren’t going for paranoid.
ENCFS_PASSWORD AddYourOwnPasswordHere
ENCRYPTED_MOUNTPOINT /mnt/backup/desktop/
# This is where we will write files unencrypted. Must be empty, must
# not be mounted already.
DECRYPTED_MOUNTPOINT /mnt/encryptedbackup/
# Required, rsync flags.
RSYNC_FLAGS -CRa –delete
# Number of snapshots. Format: [type=,...] e.g. hourly=12,daily=7
SNAPSHOTS hourly=12,daily=7,weekly=2,monthly=1
# List of file paths to rsync. Any line that doesn’t contain a space is
# a file path. Paths can be filenames or directories. This is simply
# the argument passed to rsync. As a result, you can use rsync features
# like adding a “./” directory to tell rsync which components of the
# path to sync over.
/home/quilib/./.heartbeat
/home/quilib/./music/
/home/quilib/./money/
/home/quilib/./photos/