Git Product home page Git Product logo

sync-s3's Introduction

sync-s3 ๐Ÿ“

This is a miniature CLI for syncing a folder with S3. This could probably be expanded into a proper CLI/Bash script eventually. This was created as a client request but may be useful to some.

To start

npm start

Or, to force an update of a folder:

npm run force-sync

If you want some verbose debug logging:

npm start -- --debug
npm run force-sync -- --debug

What does it do?

You set up your AWS Credentials and an S3 bucket in a .env file. Next, you run npm start and pick a directory to sync. The tool will check that directory for a few things:

  1. If an .s3backup file exists, check the timestamp inside. The timestamp represents the last sync date.
  2. Check the entire directory tree for valid files.
  3. Check each file to see if it has been create since the last backup timestamp, if there is one.
  4. If it has, add it to the stack for syncing.
  5. Sync all the required files and upload to the S3 bucket at a relative filepath (i.e, If you synced the test directory, the files would upload to test/** inside the bucket.)

Cool Tip

This is super un-intuitive but if you enter the directory that you wish to sync in your Terminal and then run the script directly using Node, i.e, node ../../sync-s3, it will check the current directory to see if a .s3backup file exists. If it does, it auto picks that directory as the one to sync.

To-dos / Improvements

  • Allow for the syncing to happen based on last modified instead of birthtime.
  • Improve file selection process.
  • Change to a bash/bin script to allow it to be installed globally and used inside of any folder.
  • Update to an Electron application/service.
  • Allow files to be ignored.
  • Allow extensions to be ignored.
  • Create a more intuitive user experience.

sync-s3's People

Contributors

lmulvey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.