Git Product home page Git Product logo

nabackupdb's Introduction

Na Backup DB

This script was created by Nicolas AGUENOT ([email protected]).

This main utility is to backup database in terms of information provided on config.sh file


Config

Rename config_sample.sh to config.sh

mv config_sample.sh config.sh

Register your informations on config.sh file like this :

## DB
DBNAME=[YOUR_DATABASE_NAME]
DBUSER=[YOUR_DATABASE_USER]
DBPSWD=[YOUR_DATABASE_PASSWORD]

## FOLDER
LASTBACKUPFOLDER=sql/lastbackup
TMPFOLDER=sql/tmpbackup
ARCHIVEFOLDER=sql/archives
RESTOREDFOLDER=sql/lastrestored

## SCRIPT PATH
MYSQLDUMPPATH=[YOUR_MYSQLDUMP_COMMAND_PATH - In general : /usr/bin/mysqldump]

## DATEFORMAT
DATEFORMAT=[YOUR DATE FORMAT - In General : %Y-%m-%d-%H-%M (Year-Month-Day-Hours-Minuts)]

## MAX BACKUP STORED - [MAXBACKUP - In General : 5]
MAXBACKUP=5

## MAX RESTORED BACKUP - [MAXRESTORE - In General : 5]
MAXRESTORE=5

How to dump my database ?

Open terminal and come to nabackupdb directory. After configurating your config.sh file, launch this command :

sh backup.sh

And It works !


How to restore my latest dumped database ?

Open terminal and come to nabackupdb directory. After configurating your config.sh file, launch this command :

sh restore.sh

And It works !

Different directory

A directory sql is created with 3 sub-directory :

archives/

containing previous backup

lastbackup/

containing latest backup.

when you relaunch the script, this backup will be move to archives/ directory.

lastrestored/

containing lastest restored file on sql format.

tmpbackup/

containing lastest backup on sql format.

when you relaunch the script, this file will be replaced by newest sql file backup.

nabackupdb's People

Contributors

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