Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mytonctrl/scripts/create_backup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dest="mytonctrl_backup_$(hostname)_$(date +%s).tar.gz"
mtc_dir="$HOME/.local/share/mytoncore"
user=$(logname)
# Get arguments
while getopts d:m: flag
do
Expand Down Expand Up @@ -38,7 +39,9 @@ systemctl start mytoncore

echo -e "${COLOR}[3/4]${ENDC} Started validator and mytoncore"

sudo tar -zcf ${dest} -C ${tmp_dir} .
tar -zcf $dest -C $tmp_dir .

chown $user:$user $dest

echo -e "${COLOR}[4/4]${ENDC} Backup successfully created in ${dest}!"
echo -e "If you wish to use archive package to migrate node to different machine please make sure to stop validator and mytoncore on donor (this) host prior to migration."
1 change: 1 addition & 0 deletions mytonctrl/scripts/restore_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ rm -rf $tmp_dir
mkdir $tmp_dir
tar -xvzf $name -C $tmp_dir

rm -rf /var/ton-work/db/keyring
cp -f ${tmp_dir}/config.json /var/ton-work/db/
cp -rf ${tmp_dir}/keyring /var/ton-work/db/
cp -rf ${tmp_dir}/keys /var/ton-work
Expand Down