gsilvestri / kapu-snapshot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kapu-snapshot

A bash script to automate backups for KAPU blockchain v0.3

##Requisites - This script works with postgres and kapu_db, configured with kapu user - You need to have sudo privileges

##Installation Execute the following commands

cd ~/
git clone https://github.com/kapucoin/kapu-snapshot.git
cd kapu-snapshot
sudo updatedb
bash kapu-snapshot.sh help

##Available commands

  • create
  • restore
  • log
  • schedule
    • hourly
    • daily
    • weekly
    • monthly

###create Command create is for create new snapshot, example of usage:
bash kapu-snapshot.sh create
Automaticly will create a snapshot file in new folder called snapshot/.
Don't require to stop you node app.js instance.
Example of output:

   + Creating snapshot                                
  -------------------------------------------------- 
  OK snapshot created successfully at block  91005 ( 154 MB).

Also will create a line in the log, there you can see your snapshot at what block height was created.

###restore Command restore is for restore the last snapshot found it in snapshot/ folder.
Example of usage:
bash kapu-snapshot.sh restore

Automaticly will pick the last snapshot file in snapshot/ folder to restore the ark.
If you want to restore a specific file please (for this version) delete or move the other files in snapshot/ folder.
You can use the log command to better pick up your restore file.

Schedule

Schedule snapshot creation periodically, with the available parameters:

- hourly
- daily
- weekly
- monthly
Example: bash kapu-snapshot.sh schedule daily 

###log Display all the snapshots created.
Example of usage:
bash kapu-snapshot.sh log

Example of output:

   + Snapshot Log                                                                  
  --------------------------------------------------                               
  09-03-2017 - 20:59:06 -- Snapshot created successfully at block  91005 ( 154 MB)  
  09-03-2017 - 21:36:07 -- Snapshot created successfully at block  91019 ( 154 MB)  
  --------------------------------------------------END                            

About


Languages

Language:Shell 100.0%