-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
arocha
committed
Dec 13, 2017
1 parent
a9872f3
commit f408ab2
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# Makes a node backup | ||
|
||
MESSAGE="Usage: backup keys | full" | ||
if ( [ $# -ne 1 ] ); then | ||
echo "$MESSAGE" | ||
exit | ||
fi | ||
|
||
CURRENT_DATE=`date +%Y%m%d%H%M%S` | ||
|
||
|
||
if ( [ "keys" == "$1" ]); then | ||
echo "Making a backup of your current node keys ..." | ||
|
||
#Backup directory tree | ||
mkdir ~/alastria-keysBackup-$CURRENT_DATE | ||
mkdir ~/alastria-keysBackup-$CURRENT_DATE/data | ||
mkdir ~/alastria-keysBackup-$CURRENT_DATE/data/geth | ||
mkdir ~/alastria-keysBackup-$CURRENT_DATE/data/constellation | ||
echo "Saving constellation keys ..." | ||
cp -r ~/alastria/data/constellation/keystore ~/alastria-keysBackup-$CURRENT_DATE/data/constellation | ||
echo "Saving node keys ..." | ||
cp -r ~/alastria/data/keystore ~/alastria-keysBackup-$CURRENT_DATE/data | ||
echo "Saving enode ID ..." | ||
cp ~/alastria/data/geth/nodekey ~/alastria-keysBackup-$CURRENT_DATE/data/nodekey | ||
fi | ||
|
||
if ( [ "full" == "$1" ]); then | ||
echo "Making a complete backup of your current node..." | ||
cp -r ~/alastria ~/alastria-backup-$CURRENT_DATE | ||
echo "Cleaning unnecessary files..." | ||
rm -Rf ~/alastria-backup-$CURRENT_DATE/logs/* | ||
rm -Rf ~/alastria-backup-$CURRENT_DATE/data/keystore/* | ||
rm -Rf ~/alastria-backup-$CURRENT_DATE/data/geth/nodekey | ||
rm -Rf ~/alastria-backup-$CURRENT_DATE/data/constellation/keystore/* | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# Prepare the node for a clean restart | ||
|
||
echo "Preparing the node for a clean restart ..." | ||
rm -Rf ~/alastria/logs/* | ||
rm -Rf ~/alastria/data/keystore/* | ||
rm -Rf ~/alastria/data/geth/nodekey | ||
rm -Rf ~/alastria/data/constellation/keystore/* |