Giter Club home page Giter Club logo

s3backupnodejs's Introduction

AWS S3 Simple File Backups w/ NodeJs

This is just a simple nodejs script to allow you make automatic backups in S3. We will use it to backup a mongoDb database.

Requirements

  1. Nodejs
  2. AWS API Credentials

Installation

#1 Clone this repository

$ git clone: https://github.com/minorsolis/s3BackupNodeJS.git
$ cd s3BackupNodeJS

#2 Go inside the app/config folder

$ cd app/config/

#3 Create your own config.js

$ cp -rp config.example.js config.js

#4 Add your credentials and configuration

  aws_key: 'aws_key_here',
  aws_secret: 'aws_secret_here',
  aws_s3_bucket: 'aws_s3_bucket',
  file_path: '/path_to_your_file/'

Optional: extend with bash

The folder includes a cron folder with a bit of bash code, just in case you need to extend this app.

open => cron/script.sh

It will show something like this

echo "Add the bash code here"

echo "..........................."
echo "cd /your_config_file_path/ && mongodump"
echo "tar -cvf dump.tar dump"
echo "..........................."

echo "Finally exec nodejs"
cd ../app/
node index.js

Setup the cron daily (or at anytime)

#1 Set the permissions

$ chmod 775 script.sh

#2 Edit the file cron/setCron.sh

0 1 * * * /{your_path}/cron/script.sh

#3 Setup the cron job

$ crontab setCron.sh

s3backupnodejs's People

Contributors

minorsolis avatar

Watchers

 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.