Skip to content

khilnani/s3sync.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()"

About

Mac/Linux compatible iOS Pythonista script to backup files to AWS S3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages