Skip to content

Instantly share code, notes, and snippets.

@adamdenes
Created June 23, 2021 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamdenes/73d1ce8c7b2a5b6bceb0c62cdaca5100 to your computer and use it in GitHub Desktop.
Save adamdenes/73d1ce8c7b2a5b6bceb0c62cdaca5100 to your computer and use it in GitHub Desktop.
Auto start chia farmer, delete temp files and start plotting
#!/bin/bash
#$HOME/chia-blockchain/venv/bin/chia start farmer && echo $(date "+%Y-%m-%d %H:%M:%S %Z"): [ chia start farmer ] starting farmer
#start chia farmer
cd $HOME/chia-blockchain/ && . ./activate && chia start farmer && echo $(date "+%Y-%m-%d %H:%M:%S %Z"): [ chia start farmer ] starting farmer
#not needed, leaving here anyway
swapoff -a && sleep 5s && swapon -a && echo $(date "+%Y-%m-%d %H:%M:%S %Z"): Swap cleared!
#delete .tmp files from ssd's
cd /mnt/ssd && find . -maxdepth 1 -name '*.tmp' -delete && echo $(date "+%Y-%m-%d %H:%M:%S %Z"): .tmp files deleted!
#starting plots
screen -d -m -S chia bash -c 'cd $HOME/chia-blockchain/ && . ./activate && plotman plot'
@adamdenes
Copy link
Author

Start this with reboot via crontab.
crontab -e

@reboot /home/adam/clearcache.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment