Python scripts for Tarsnap.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE.markdown
README.markdown
tarsnap_backup.py
tarsnap_config.py.sample
tarsnap_delete_old.py
tarsnap_list.py

README.markdown

TarPy

Python scripts for Tarsnap.

Usage:

  1. Set yourself up with Tarsnap.

  2. Copy or rename tarsnap_config.py.sample to tarsnap_config.py

     $ mv tarsnap_config.py.sample tarsnap_config.py
    
  3. Add your Tarsnap keyfile and cachedir to the tarsnap_config dictionary in tarsnap_config.py as absolute paths:

     tarsnap_config = {
     	"keyfile": "/Users/<username>/tarsnap.key",
     	"cachedir": "/Users/<username>/tarsnap-cache"
     }
    

    Important: Be sure to include the leading slash on the keyfile and cachedir paths.

  4. Add the files and directories you want to archive to the tarsnap_backup_paths dictionary in tarsnap_config.py as absolute paths:

     tarsnap_backup_paths = {
     	"documents": "Users/<username>/Documents",
     	"pictures": "Users/<username>/Pictures"
     }
    

    Important: tarsnap_backup.py will cd into the root directory before creating each archive, so you should omit the leading slash from each path. The keys in this dictionary will be used as the archive names. The current date in ISO format will be appended to the archive name for each new archive.

  5. Run tarsnap_list.py to list your current archives:

     $ python tarsnap_list.py
    
  6. Run tarsnap_backup.py to create new archives for the files and directories you added in step 4:

     $ python tarsnap_backup.py
    
  7. Run tarsnap_delete_old.py to delete archives older than a given age:

     $ python tarsnap_delete_old.py <time_interval> <time_unit>
    

    Where <time_interval> is an integer and <time_unit> is seconds, minutes, hours, days or weeks:

     $ python tarsnap_delete_old.py 7 days
    

License:

TarPy is made available under the MIT License. See LICENSE.markdown for details.

Credits:

TarPy was created by Tony Wallace. It has been tested with Python 2.7 on OSX 10.10 Yosemite. I welcome bugfixes and compatibility fixes for other operating systems.