Coder Social home page Coder Social logo

thisistaehun / bacth-backup-module Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

NestJS를 활용하여 만든, 배치 작업으로 데이터를 백업하기 위한 간단한 모듈입니다. Minimal batch backup module using nestjs

JavaScript 9.66% TypeScript 90.34%

bacth-backup-module's Introduction

Nest Logo

Nestjs Batch Back-up Module

Description

일정 주기로 데이터베이스에서 데이터를 백업하기 위한 모듈입니다. 도커 환경에서 작동합니다. 도커 데몬을 포함하여, mysql 또는 postgresql 등의 데이터베이스가 이미 컨테이너화 되어 동작하고 있어야 합니다.

Installation

루트 폴더에서 의존성을 설치합니다.

yarn 

Environment Variables

앱 실행 전 환경 변수를 설정합니다. .env.example 파일을 참고하여 .env 파일을 생성합니다.

# .env.example
NODE_ENV='local' # 앱 실행 환경
SERVER_PORT=3001 # 앱이 실행될 포트
DATABASE_HOST='my-db' # 데이터베이스 호스트
DATABASE_PORT=3306 # 데이터베이스 포트
DATABASE_USER='root' # 데이터베이스 유저
DATABASE_PASSWORD='root' # 데이터베이스 비밀번호
DATABASE_SCHEMA='test-db' # 데이터베이스 스키마
DATABASE_SYNCHRONIZE=true # 데이터베이스 동기화
REMOVE_OLD_BACKUP_FILES_DAYS=7 # 백업 파일 보관 기간

Running the app

yarn start를 통해 앱을 실행합니다.

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn run start:prod

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Run with pm2

package.json의 yarn pm2 scripts를 통해 pm2를 실행합니다. 실행에 관한 정의는 ecosystem.config.js 파일을 참고합니다.

yarn pm2

bacth-backup-module's People

Contributors

thisistaehun 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.