Skip to content
Mac/Linux compatible iOS Pythonista script to backup files to AWS S3
Branch: master
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
README.md
install.py
s3sync.conf.schema
s3sync.py
s3sync.sample.conf

README.md

s3sync.py

Backup and restore files from the working directory to an Amazon AWS S3 bucket. Supports both, iOS Pythonista and Desktop Linux/Mac OS.

When run within iOS Pythonista, a native ui allows action/command selection. Linux/Mac OS display is limited to the terminal/console.

I use this to share/sync code between my iPhone, iPad, and Mac laptop.

By default, the script backups the following locations:

  • Pythonista:
    • Files downloaded to and restored from the ~/Documents directory.
  • Linux/mac os:
    • Files downloaded to and restored from the working directory, not the directory containing the script.
    • Example: Run python s3sync.py [ACTION]
      • ACTION: Optional, any of the commands displayed when the script is run.

Configuration

  • A JSON configuration file s3sync.conf can be used to store configurations.
  • If missing, the script will prompt for information each time it is run.
  • See s3sync.sample.conf for a full list of options. JSON Schema is used for its schema documentation.

Usage

  • Copy s3sync.sample.conf to the same directory as the s3sync.py script and rename to s3sync.conf
  • Update config file as appropriate.

AWS Authentication

  • Since the script uses the AWS boto library, it supports all of the authentication methods boto does:
    • Environment variables, AWS Credentials, AWS Config, boto2 or boto3 configuration.
    • See AWS boto3 Credentials Docs for more details
  • If you would like to manage the authentication configuration separately, you can add AWS credentials to s3sync.conf.

Installation

  • Download or clone the github repo, or:
    • Pythonista console: import urllib2; exec urllib2.urlopen('http://khl.io/s3sync-py').read()
    • Linux/Mac OS Terminal: python -c "import urllib2; exec urllib2.urlopen('http://khl.io/s3sync-py').read()"
You can’t perform that action at this time.