Python scripts for Tarsnap.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



Python scripts for Tarsnap.


  1. Set yourself up with Tarsnap.

  2. Copy or rename to

     $ mv
  3. Add your Tarsnap keyfile and cachedir to the tarsnap_config dictionary in 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 as absolute paths:

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

    Important: 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 to list your current archives:

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

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

     $ python <time_interval> <time_unit>

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

     $ python 7 days


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


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.