Browse Source

update loop backup

Your Name 3 years ago
parent
commit
ee9aae2b84
3 changed files with 30 additions and 116 deletions
  1. 4 4
      make_deps.sh
  2. 25 111
      upload_bootstrap.sh
  3. 1 1
      upload_mega.sh

+ 4 - 4
make_deps.sh

@@ -112,7 +112,7 @@ wget -c -q --show-progress http://wareck.free.fr/crypto/okcash/miniupnpc-$Miniup
 wget -c -q --show-progress http://download.oracle.com/berkeley-db/db-$DB_v.tar.gz
 wget -c -q --show-progress http://download.oracle.com/berkeley-db/db-$DB_v.NC.tar.gz
 wget -c -q --show-progress https://www.openssl.org/source/openssl-$OpenSSL_v.tar.gz
-if ! [ -d badown ];then git clone http://gogserver.dnsalias.com:3000/wareck/badown.git;fi
+if ! [ -d megadown ];then git clone http://gogserver.dnsalias.com:3000/wareck/megadown.git;fi
 echo "Done."
 }
 
@@ -145,11 +145,11 @@ echo ""
 echo -e "\n\e[95mCompress libraries :\e[0m"
 sleep 1
 echo -e "megadown:"
-cd badown
-tar cvfj megadown.tar.bz2 megadown 
+cd megadown
+tar cvfj megadown.tar.bz2 megadown
 echo -n " Ok."
 cd ..
-mv badown/megadown.tar.bz2 .
+mv megadown/megadown.tar.bz2 .
 echo -e "\nokcash_v5.0.0.5-core.bliss:"
 cp -r okcash-5.0.0.5-core.bliss okcash
 tar cf okcash_$okcash_v.tar.xz okcash --checkpoint=.250 -Ipixz

+ 25 - 111
upload_bootstrap.sh

@@ -9,9 +9,11 @@ ftp_i=0
 pv_i=0
 retry_flag=0
 daemon_on=0
-split_size=250
+dfolder="bootstrap_backup"
+split_size=500
 
 echo -e "\n\e[97mOkcash Blockchain Uploader v$version ($date)\e[0m"
+echo -e "FTP version (backup)"
 echo -e "wareck : wareck@gmail.com"
 echo -e ""
 echo -e "\e[93mArchive size \e[0m: $split_size Mo"
@@ -134,40 +136,11 @@ tar cf - .okcash/txleveldb/* .okcash/blk0001.dat | pv -s ${SIZE}k | pixz  > boot
 sleep 1
 
 echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
-split --verbose -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
+split --verbose -d -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
 rm bootstrap.tar.xz
 sleep 1
 echo "Done."
 
-echo -e "\n\e[95mRename Files:\e[0m"
-if [ -f bootstrap.partaa ]; then mv bootstrap.partaa bootstrap.part01 && echo "bootstrap.partaa >> bootstrap.part01" ;fi
-if [ -f bootstrap.partab ]; then mv bootstrap.partab bootstrap.part02 && echo "bootstrap.partab >> bootstrap.part02" ;fi
-if [ -f bootstrap.partac ]; then mv bootstrap.partac bootstrap.part03 && echo "bootstrap.partac >> bootstrap.part03" ;fi
-if [ -f bootstrap.partad ]; then mv bootstrap.partad bootstrap.part04 && echo "bootstrap.partad >> bootstrap.part04" ;fi
-if [ -f bootstrap.partae ]; then mv bootstrap.partae bootstrap.part05 && echo "bootstrap.partae >> bootstrap.part05" ;fi
-if [ -f bootstrap.partaf ]; then mv bootstrap.partaf bootstrap.part06 && echo "bootstrap.partaf >> bootstrap.part06" ;fi
-if [ -f bootstrap.partag ]; then mv bootstrap.partag bootstrap.part07 && echo "bootstrap.partag >> bootstrap.part07" ;fi
-if [ -f bootstrap.partah ]; then mv bootstrap.partah bootstrap.part08 && echo "bootstrap.partah >> bootstrap.part08" ;fi
-if [ -f bootstrap.partai ]; then mv bootstrap.partai bootstrap.part09 && echo "bootstrap.partai >> bootstrap.part09" ;fi
-if [ -f bootstrap.partaj ]; then mv bootstrap.partaj bootstrap.part10 && echo "bootstrap.partaj >> bootstrap.part10" ;fi
-if [ -f bootstrap.partak ]; then mv bootstrap.partak bootstrap.part11 && echo "bootstrap.partak >> bootstrap.part11" ;fi
-if [ -f bootstrap.partal ]; then mv bootstrap.partal bootstrap.part12 && echo "bootstrap.partal >> bootstrap.part12" ;fi
-if [ -f bootstrap.partam ]; then mv bootstrap.partam bootstrap.part13 && echo "bootstrap.partam >> bootstrap.part13" ;fi
-if [ -f bootstrap.partan ]; then mv bootstrap.partan bootstrap.part14 && echo "bootstrap.partan >> bootstrap.part14" ;fi
-if [ -f bootstrap.partao ]; then mv bootstrap.partao bootstrap.part15 && echo "bootstrap.partao >> bootstrap.part15" ;fi
-if [ -f bootstrap.partap ]; then mv bootstrap.partap bootstrap.part16 && echo "bootstrap.partap >> bootstrap.part16" ;fi
-if [ -f bootstrap.partaq ]; then mv bootstrap.partaq bootstrap.part17 && echo "bootstrap.partaq >> bootstrap.part17" ;fi
-if [ -f bootstrap.partar ]; then mv bootstrap.partar bootstrap.part18 && echo "bootstrap.partar >> bootstrap.part18" ;fi
-if [ -f bootstrap.partas ]; then mv bootstrap.partas bootstrap.part19 && echo "bootstrap.partas >> bootstrap.part19" ;fi
-if [ -f bootstrap.partat ]; then mv bootstrap.partat bootstrap.part20 && echo "bootstrap.partat >> bootstrap.part20" ;fi
-if [ -f bootstrap.partau ]; then mv bootstrap.partau bootstrap.part21 && echo "bootstrap.partau >> bootstrap.part21" ;fi
-if [ -f bootstrap.partav ]; then mv bootstrap.partav bootstrap.part22 && echo "bootstrap.partav >> bootstrap.part22" ;fi
-if [ -f bootstrap.partaw ]; then mv bootstrap.partaw bootstrap.part23 && echo "bootstrap.partaw >> bootstrap.part23" ;fi
-if [ -f bootstrap.partax ]; then mv bootstrap.partax bootstrap.part24 && echo "bootstrap.partax >> bootstrap.part24" ;fi
-if [ -f bootstrap.partay ]; then mv bootstrap.partay bootstrap.part25 && echo "bootstrap.partay >> bootstrap.part25" ;fi
-if [ -f bootstrap.partaz ]; then mv bootstrap.partay bootstrap.part26 && echo "bootstrap.partaz >> bootstrap.part26" ;fi
-echo "Done."
-
 echo -e "\n\e[95mMake bootstrap_v.txt:\e[0m"
 Raw_date="`date +%d%m%Y`"
 YYYY=`ls -l bootstrap*.part* | wc -l`
@@ -181,32 +154,12 @@ sed -i -e "s/YYYY/$YYYY/g" bootstrap_v.txt
 echo "Done."
 
 echo -e "\n\e[95mMd5sum Files:\e[0m"
-if [ -f bootstrap.part01 ]; then echo -e -n "md5sum Bootstrap.part01: " && md5sum bootstrap.part01 > bootstrap01.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part02 ]; then echo -e -n "md5sum Bootstrap.part02: " && md5sum bootstrap.part02 > bootstrap02.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part03 ]; then echo -e -n "md5sum Bootstrap.part03: " && md5sum bootstrap.part03 > bootstrap03.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part04 ]; then echo -e -n "md5sum Bootstrap.part04: " && md5sum bootstrap.part04 > bootstrap04.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part05 ]; then echo -e -n "md5sum Bootstrap.part05: " && md5sum bootstrap.part05 > bootstrap05.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part06 ]; then echo -e -n "md5sum Bootstrap.part06: " && md5sum bootstrap.part06 > bootstrap06.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part07 ]; then echo -e -n "md5sum Bootstrap.part07: " && md5sum bootstrap.part07 > bootstrap07.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part08 ]; then echo -e -n "md5sum Bootstrap.part08: " && md5sum bootstrap.part08 > bootstrap08.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part09 ]; then echo -e -n "md5sum Bootstrap.part09: " && md5sum bootstrap.part09 > bootstrap09.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part10 ]; then echo -e -n "md5sum Bootstrap.part10: " && md5sum bootstrap.part10 > bootstrap10.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part11 ]; then echo -e -n "md5sum Bootstrap.part11: " && md5sum bootstrap.part11 > bootstrap11.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part12 ]; then echo -e -n "md5sum Bootstrap.part12: " && md5sum bootstrap.part12 > bootstrap12.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part13 ]; then echo -e -n "md5sum Bootstrap.part13: " && md5sum bootstrap.part13 > bootstrap13.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part14 ]; then echo -e -n "md5sum Bootstrap.part14: " && md5sum bootstrap.part14 > bootstrap14.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part15 ]; then echo -e -n "md5sum Bootstrap.part15: " && md5sum bootstrap.part15 > bootstrap15.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part16 ]; then echo -e -n "md5sum Bootstrap.part16: " && md5sum bootstrap.part16 > bootstrap16.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part17 ]; then echo -e -n "md5sum Bootstrap.part17: " && md5sum bootstrap.part17 > bootstrap17.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part18 ]; then echo -e -n "md5sum Bootstrap.part18: " && md5sum bootstrap.part18 > bootstrap18.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part19 ]; then echo -e -n "md5sum Bootstrap.part19: " && md5sum bootstrap.part19 > bootstrap19.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part20 ]; then echo -e -n "md5sum Bootstrap.part20: " && md5sum bootstrap.part20 > bootstrap20.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part21 ]; then echo -e -n "md5sum Bootstrap.part21: " && md5sum bootstrap.part21 > bootstrap21.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part22 ]; then echo -e -n "md5sum Bootstrap.part22: " && md5sum bootstrap.part22 > bootstrap22.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part23 ]; then echo -e -n "md5sum Bootstrap.part23: " && md5sum bootstrap.part23 > bootstrap23.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part24 ]; then echo -e -n "md5sum Bootstrap.part24: " && md5sum bootstrap.part24 > bootstrap24.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part25 ]; then echo -e -n "md5sum Bootstrap.part25: " && md5sum bootstrap.part25 > bootstrap25.md5 && echo -e "\e[1mDone.\e[0m"; fi
-if [ -f bootstrap.part26 ]; then echo -e -n "md5sum Bootstrap.part26: " && md5sum bootstrap.part26 > bootstrap26.md5 && echo -e "\e[1mDone.\e[0m"; fi
+zap=$(ls -l bootstrap.part* | wc -l)
+zap=$((zap-1))
+for i in `seq -w 00 $zap`
+do
+echo -e -n "md5sum Bootstrap.part$i: " && md5sum bootstrap.part$i > bootstrap$i.md5 && echo -e "\e[1mDone.\e[0m"
+done
 touch /home/$USER/bootstrap_uploadpass
 }
 
@@ -226,7 +179,7 @@ fi
 
 function ftp_loop {
 lftp -u wareck,zorn692611 ftpperso.free.fr <<EOF
-put $ftp_file -o /crypto/okcash/bootstrap/$ftp_file
+put $ftp_file -o /crypto/okcash/$dfolder/$ftp_file
 EOF
 echo -n $ftp_file && echo -e ": \e[1mDone.\e[0m";
 }
@@ -234,60 +187,21 @@ echo -n $ftp_file && echo -e ": \e[1mDone.\e[0m";
 function upload {
 cd /home/$USER
 echo -e "\n\e[95mUpload files to server :\e[0m"
+ftp_file=bootstrap_v.txt && ftp_loop
+zap=$(ls -l bootstrap.part* | wc -l)
+zap=$((zap-1))
+for i in `seq -w 00 $zap`
+do
+ftp_file=bootstrap.part$i
+ftp_loop
+done
+sleep 3
 
-if [ -f bootstrap_v.txt ];then ftp_file=bootstrap_v.txt && ftp_loop ;fi
-if [ -f bootstrap.part01 ];then ftp_file=bootstrap.part01 && ftp_loop ;fi
-if [ -f bootstrap.part02 ];then ftp_file=bootstrap.part02 && ftp_loop ;fi
-if [ -f bootstrap.part03 ];then ftp_file=bootstrap.part03 && ftp_loop ;fi
-if [ -f bootstrap.part04 ];then ftp_file=bootstrap.part04 && ftp_loop ;fi
-if [ -f bootstrap.part05 ];then ftp_file=bootstrap.part05 && ftp_loop ;fi
-if [ -f bootstrap.part06 ];then ftp_file=bootstrap.part06 && ftp_loop ;fi
-if [ -f bootstrap.part07 ];then ftp_file=bootstrap.part07 && ftp_loop ;fi
-if [ -f bootstrap.part08 ];then ftp_file=bootstrap.part08 && ftp_loop ;fi
-if [ -f bootstrap.part09 ];then ftp_file=bootstrap.part09 && ftp_loop ;fi
-if [ -f bootstrap.part10 ];then ftp_file=bootstrap.part10 && ftp_loop ;fi
-if [ -f bootstrap.part11 ];then ftp_file=bootstrap.part11 && ftp_loop ;fi
-if [ -f bootstrap.part12 ];then ftp_file=bootstrap.part12 && ftp_loop ;fi
-if [ -f bootstrap.part13 ];then ftp_file=bootstrap.part13 && ftp_loop ;fi
-if [ -f bootstrap.part14 ];then ftp_file=bootstrap.part14 && ftp_loop ;fi
-if [ -f bootstrap.part15 ];then ftp_file=bootstrap.part15 && ftp_loop ;fi
-if [ -f bootstrap.part16 ];then ftp_file=bootstrap.part16 && ftp_loop ;fi
-if [ -f bootstrap.part17 ];then ftp_file=bootstrap.part17 && ftp_loop ;fi
-if [ -f bootstrap.part18 ];then ftp_file=bootstrap.part18 && ftp_loop ;fi
-if [ -f bootstrap.part19 ];then ftp_file=bootstrap.part19 && ftp_loop ;fi
-if [ -f bootstrap.part20 ];then ftp_file=bootstrap.part20 && ftp_loop ;fi
-if [ -f bootstrap.part21 ];then ftp_file=bootstrap.part21 && ftp_loop ;fi
-if [ -f bootstrap.part22 ];then ftp_file=bootstrap.part22 && ftp_loop ;fi
-if [ -f bootstrap.part23 ];then ftp_file=bootstrap.part23 && ftp_loop ;fi
-if [ -f bootstrap.part24 ];then ftp_file=bootstrap.part24 && ftp_loop ;fi
-if [ -f bootstrap.part25 ];then ftp_file=bootstrap.part25 && ftp_loop ;fi
-if [ -f bootstrap.part26 ];then ftp_file=bootstrap.part26 && ftp_loop ;fi
-if [ -f bootstrap01.md5 ];then ftp_file=bootstrap01.md5 && ftp_loop ;fi
-if [ -f bootstrap02.md5 ];then ftp_file=bootstrap02.md5 && ftp_loop ;fi
-if [ -f bootstrap03.md5 ];then ftp_file=bootstrap03.md5 && ftp_loop ;fi
-if [ -f bootstrap04.md5 ];then ftp_file=bootstrap04.md5 && ftp_loop ;fi
-if [ -f bootstrap05.md5 ];then ftp_file=bootstrap05.md5 && ftp_loop ;fi
-if [ -f bootstrap06.md5 ];then ftp_file=bootstrap06.md5 && ftp_loop ;fi
-if [ -f bootstrap07.md5 ];then ftp_file=bootstrap07.md5 && ftp_loop ;fi
-if [ -f bootstrap08.md5 ];then ftp_file=bootstrap08.md5 && ftp_loop ;fi
-if [ -f bootstrap09.md5 ];then ftp_file=bootstrap09.md5 && ftp_loop ;fi
-if [ -f bootstrap10.md5 ];then ftp_file=bootstrap10.md5 && ftp_loop ;fi
-if [ -f bootstrap11.md5 ];then ftp_file=bootstrap11.md5 && ftp_loop ;fi
-if [ -f bootstrap12.md5 ];then ftp_file=bootstrap12.md5 && ftp_loop ;fi
-if [ -f bootstrap13.md5 ];then ftp_file=bootstrap13.md5 && ftp_loop ;fi
-if [ -f bootstrap14.md5 ];then ftp_file=bootstrap14.md5 && ftp_loop ;fi
-if [ -f bootstrap15.md5 ];then ftp_file=bootstrap15.md5 && ftp_loop ;fi
-if [ -f bootstrap16.md5 ];then ftp_file=bootstrap16.md5 && ftp_loop ;fi
-if [ -f bootstrap17.md5 ];then ftp_file=bootstrap17.md5 && ftp_loop ;fi
-if [ -f bootstrap18.md5 ];then ftp_file=bootstrap18.md5 && ftp_loop ;fi
-if [ -f bootstrap19.md5 ];then ftp_file=bootstrap19.md5 && ftp_loop ;fi
-if [ -f bootstrap20.md5 ];then ftp_file=bootstrap20.md5 && ftp_loop ;fi
-if [ -f bootstrap21.md5 ];then ftp_file=bootstrap21.md5 && ftp_loop ;fi
-if [ -f bootstrap22.md5 ];then ftp_file=bootstrap22.md5 && ftp_loop ;fi
-if [ -f bootstrap23.md5 ];then ftp_file=bootstrap23.md5 && ftp_loop ;fi
-if [ -f bootstrap24.md5 ];then ftp_file=bootstrap24.md5 && ftp_loop ;fi
-if [ -f bootstrap25.md5 ];then ftp_file=bootstrap25.md5 && ftp_loop ;fi
-if [ -f bootstrap26.md5 ];then ftp_file=bootstrap26.md5 && ftp_loop ;fi
+for j in `seq -w 00 $zap`
+do
+ftp_file=bootstrap$j.md5
+ftp_loop
+done
 
 freeze_off
 echo -e "\n\e[92mUpload Done ...\n\e[0m"

+ 1 - 1
upload_mega.sh

@@ -137,7 +137,7 @@ sleep 1
 echo "Done."
 
 echo -e "\n\e[95mSplitting Files (${split_size}M):\e[0m"
-split --verbose -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
+split --verbose -d -b ${split_size}M bootstrap.tar.xz "bootstrap.part"
 rm bootstrap.tar.xz
 sleep 1
 echo "Done."