Browse Source

#685 change delete commands

v1.3
Christian Rotzoll 6 years ago
parent
commit
a87dbbc59c
  1. 62
      home.admin/XXcleanHDD.sh

62
home.admin/XXcleanHDD.sh

@ -41,12 +41,18 @@ elif [ "${extraParameter}" = "-blockchain" ]; then
sudo systemctl stop litecoind.service 2>/dev/null sudo systemctl stop litecoind.service 2>/dev/null
echo "" echo ""
echo "DELETING ..." echo "DELETING ..."
sudo rm -f -r /mnt/hdd/bitcoin/blocks 2>/dev/null
sudo rm -f -r /mnt/hdd/bitcoin/chainstate 2>/dev/null # delete bitcoin blockchain (but keep config)
sudo rm -f -r /mnt/hdd/litecoin/blocks 2>/dev/null sudo mv /mnt/hdd/bitcoin/bitcoin.conf /mnt/hdd/bitcoin.conf
sudo rm -f -r /mnt/hdd/litecoin/chainstate 2>/dev/null sudo rm -f -r /mnt/hdd/bitcoin/*
sudo rm -f /mnt/hdd/bitcoin/debug.log 2>/dev/null sudo mv /mnt/hdd/bitcoin.conf /mnt/hdd/bitcoin/bitcoin.conf
sudo rm -f /mnt/hdd/litecoin/debug.log 2>/dev/null sudo chown -R bitcoin:bitcoin /mnt/hdd/bitcoin
# delete litecoin blockchain (but keep config)
sudo mv /mnt/hdd/litecoin/litecoin.conf /mnt/hdd/litecoin.conf
sudo rm -f -r /mnt/hdd/litecoin/*
sudo mv /mnt/hdd/litecoin.conf /mnt/hdd/litecoin/litecoin.conf
sudo chown -R bitcoin:bitcoin /mnt/hdd/litecoin
echo "OK Blockchain data deleted - you may want now run: /home/admin/98repairBlockchain.sh" echo "OK Blockchain data deleted - you may want now run: /home/admin/98repairBlockchain.sh"
@ -58,43 +64,47 @@ else
read key read key
echo "stopping services ... (please wait)" echo "stopping services ... (please wait)"
echo "- swap" echo "- swap"
sudo dphys-swapfile swapoff sudo dphys-swapfile swapoff
echo "- background" echo "- background"
sudo systemctl stop background 2>/dev/null sudo systemctl stop background 2>/dev/null
echo "- lnd" echo "- lnd"
sudo systemctl stop lnd.service 2>/dev/null sudo systemctl stop lnd.service 2>/dev/null
echo "- blockchain" echo "- blockchain"
sudo systemctl stop bitcoind.service 2>/dev/null sudo systemctl stop bitcoind.service 2>/dev/null
sudo systemctl stop litecoind.service 2>/dev/null sudo systemctl stop litecoind.service 2>/dev/null
# just delete selective # just delete selective
echo "selective delete ... (please wait)" echo "selective delete ... (please wait)"
sudo rm -f /mnt/hdd/swapfile
sudo rm -f /mnt/hdd/bitcoin/bitcoin.conf # bitcoin mainnet (clean working files)
sudo rm -f /mnt/hdd/bitcoin/bitcoin.pid sudo rm -f /mnt/hdd/bitcoin/*.*
sudo rm -f /mnt/hdd/bitcoin/*.dat sudo rm -f -r /mnt/hdd/bitcoin/database
sudo rm -f /mnt/hdd/bitcoin/*.log
sudo rm -f /mnt/hdd/bitcoin/*.pid # bitcoin testnet (clean working files)
sudo rm -f /mnt/hdd/bitcoin/testnet3/*.dat sudo rm -f /mnt/hdd/bitcoin/testnet3/*.*
sudo rm -f /mnt/hdd/bitcoin/testnet3/*.log sudo rm -f -r /mnt/hdd/bitcoin/testnet/database
sudo rm -f /mnt/hdd/bitcoin/testnet3/.lock
sudo rm -f /mnt/hdd/litecoin/litecoin.conf # litecoin mainnet (clean working files)
sudo rm -f /mnt/hdd/litecoin/litecoin.pid sudo rm -f /mnt/hdd/litecoin/*.*
sudo rm -f /mnt/hdd/litecoin/*.dat sudo rm -f -r /mnt/hdd/litecoin/database
sudo rm -f /mnt/hdd/litecoin/*.log
sudo rm -f /mnt/hdd/litecoin/*.pid # lnd (delet all)
sudo rm -f -r /mnt/hdd/lnd
sudo rm -f -r /mnt/hdd/backup_lnd
# mixed other files and folders (all)
sudo rm -f -r /mnt/hdd/lost+found sudo rm -f -r /mnt/hdd/lost+found
sudo rm -f -r /mnt/hdd/download sudo rm -f -r /mnt/hdd/download
sudo rm -f -r /mnt/hdd/tor sudo rm -f -r /mnt/hdd/tor
sudo rm -f -r /mnt/hdd/temp sudo rm -f -r /mnt/hdd/temp
sudo rm -f -r /mnt/hdd/backup_lnd
sudo rm -f -r /mnt/hdd/backup_lnd
sudo rm -f -r /mnt/hdd/lnd
sudo rm -f -r /mnt/hdd/ssh sudo rm -f -r /mnt/hdd/ssh
sudo rm -f /mnt/hdd/raspiblitz.conf sudo rm -f /mnt/hdd/swapfile
sudo rm -f /home/admin/raspiblitz.info sudo rm -f /mnt/hdd/*.*
fi fi

Loading…
Cancel
Save