A bash script to automate backups for Skelpy blockchain
##Requisites - This script works with postgres and skp_db, configured with skp user - You need to have sudo privileges
##Installation Execute the following commands
cd ~/
git clone https://github.com/skelpycoin/skp-snapshot.git
cd skp-snapshot
sudo updatedb
bash skp-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 skp-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 26583 ( 31 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 skp-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 skp-snapshot.sh schedule daily
###log
Display all the snapshots created.
Example of usage:
bash skp-snapshot.sh log
Example of output:
+ Snapshot Log
--------------------------------------------------
23-09-2018 - 02:12:37 -- OK snapshot created successfully at block 26583 ( 31 MB).
--------------------------------------------------END