Back up the following directories and files within the PluginNode.
- data-feed-setup/
- external-adapter-feeds/
- external-adapter-template/
- dump.pm2
The above directories and files are assumed to be located in the following location.
~/plugin-deployment/
│ ├── data-feed-setup/
│ ├── external-adapter-feeds/
│ └── external-adapter-template/
~/.pm2/
└── dump.pm2
Backup of conf and db
It is recommended to backup Conf files
and Database files
beforehand.
cd ~/plugin-deployment && ./_plinode_setup_bkup.sh && ./_plinode_backup.sh -full
cd $HOME
git clone https://github.com/11ppm/pli_pm2
cd pli_pm2
chmod +x *.sh
./pm2process_backup.sh
- Backup the above directories and files to
/plinode_backups
. - The backup file will have a file name including the host name and date and time, in the format of
pm2process.tar.gz
. - Only backup the directories set on the node.
When executed, it will stop the pm2 process first.
Next, the backup of the pm2 process will start.
Once the backup is finished, you will be asked if you want to restart the pm2 process. If you want to restart, please enter Y(y)
. The restart will begin. If not, enter N(n)
to exit. If no Y/N input is received within 30 seconds
, pm2 will remain stopped and the session will end.
If the backup is successful, a message indicating success will be displayed. Then, you will be able to check the backed-up files by seeing the list of backed-up files in the /plinode_backups
directory.
./pm2process_restore.sh
-
Executing will show a list of backup files in
/plinode_backups
in increments of 10. Select the number of the file you want to restore. -
If the desired file is not listed in the displayed list, press
n
to go to the next page. When the desiredpm2process
file is found, enter the number. -
The list will also display
conf
anddb
files, but they cannot be selected. If you want to restore these files, please refer to the following site GoPlugin official site. -
After selecting the number, there will be a confirmation. If you wish to proceed, enter
y
, if you wish to cancel, enterq
. Enteringy
will start the restore process.
The script will display a list of backup files 10 at a time.
When the restoration begins, all pm2 processes are first stopped.
Starts restoring the backup file.
Directories and files to be restored are as follows Only backed up directories and files will be restored.
- data-feed-setup/
- external-adapter-feeds/
- external-adapter-template/
- dump.pm2
The restoration is to be performed at the following locations
~/plugin-deployment/
│ ├── data-feed-setup/
│ ├── external-adapter-feeds/
│ └── external-adapter-template/
~/.pm2/
└── dump.pm2
When the restore is complete, restart the pm2 service and restart the pm2 process.
Finally, make sure that the ↺
number in the pm2 process has not increased.
The repository may be updated, in which case the following command should be executed to update the repository.
cd ~/pli_pm2
git fetch
git reset --hard HEAD
git merge '@{u}'
chmod +x *.sh
- @11ppm