Code Monkey home page Code Monkey logo

meteor-script-backup's Introduction

meteor-script-backup

Easy backup script for Meteor App

Installation

  1. Create a backup directory where you want to store your backup. EG. /backup
  2. Change the variable of the script to your liking.
  • dbName is the name of the MongoDB base.
  • cfsLoc is the location of your CFS directory if needed.
  • curdate is the date command format you want to use.
  • backupLoc is the directory you've created to store your backup.
  1. Set a cron to run the script when you want. EG.

0 2 * * 0 sh /backup/backup.sh >> /backup/logs 2>&1 for every monday at 2:00 AM.

  1. You should REALLY add a SCP or any other way to extract your backup from the server

Manual Backup

If your backup are store in /backup, as root, run the following command:

sh /backup/backup.sh >> /backup/logs 2>&1

Manual Restore

If your backup are store in /backup, as root, run the following commands where 11-11-11 is the backup date:

  • tar -xf mongo-11-11-11.tar.gz -C mongo-11-11-11
  • mongorestore --dir mongo-11-11-11
  • tar -xf cfs-11-11-11.tar.gz -C cfs-11-11-11
  • cp -r cfs-11-11-11 /opt/mywebsite/cfs
  • rm -r mongo-11-11-11 cfs-11-11-11

To restore in dev environment :

  • mongorestore --dir mongo-11-11-11/SITENAME -h IPADDRESS --port PORT -d DATABASENAME

meteor-script-backup's People

Contributors

wdhif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

meteor-script-backup's Issues

Script fails as is when executed with a cron job

Hi,

this is is more of a question actually, I though you might help

I found that I had to remove the t option from the docker run -it ... line for the script to execute properly when launched via cron

otherwise I get a cannot enable tty mode on non tty input error in the logs
and the dup is not performed as far as I can tell

have you encountered the same issue?

not a big deal since just using -i seems to solve the issue but I thought I'd ask since I'm pretty new to docker (among other things :)

thanks

thomas

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.