Skip to content

Commit c00f8c3

Browse files
committed
add ton_dir option to create_backup.sh
1 parent 2977185 commit c00f8c3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mytonctrl/scripts/create_backup.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
dest="mytonctrl_backup_$(hostname)_$(date +%s).tar.gz"
22
mtc_dir="$HOME/.local/share/mytoncore"
33
user=$(logname)
4+
ton_dir="/var/ton-work"
45
# Get arguments
5-
while getopts d:m: flag
6+
while getopts d:m:t: flag
67
do
78
case "${flag}" in
89
d) dest=${OPTARG};;
910
m) mtc_dir=${OPTARG};;
11+
t) ton_dir=${OPTARG};;
1012
*)
1113
echo "Flag -${flag} is not recognized. Aborting"
1214
exit 1 ;;
@@ -26,9 +28,9 @@ rm -rf $tmp_dir
2628
mkdir $tmp_dir
2729
mkdir $tmp_dir/db
2830

29-
cp /var/ton-work/db/config.json ${tmp_dir}/db
30-
cp -r /var/ton-work/db/keyring ${tmp_dir}/db
31-
cp -r /var/ton-work/keys ${tmp_dir}
31+
cp $ton_dir/db/config.json ${tmp_dir}/db
32+
cp -r $ton_dir/db/keyring ${tmp_dir}/db
33+
cp -r $ton_dir/keys ${tmp_dir}
3234
cp -r $mtc_dir $tmp_dir
3335

3436
python3 -c "import json;f=open('${tmp_dir}/db/config.json');json.load(f);f.close()" || exit 1 # Check if config.json is copied correctly

0 commit comments

Comments
 (0)