Skip to content

Instantly share code, notes, and snippets.

@wallentx
Last active March 23, 2021 07:23
Show Gist options
  • Save wallentx/d1e3ef3792c8a529776c44d6270a19a0 to your computer and use it in GitHub Desktop.
Save wallentx/d1e3ef3792c8a529776c44d6270a19a0 to your computer and use it in GitHub Desktop.
Watch -d dir for completed plots, then exec a mv to other path
#!/usr/bin/env bash
# uses https://github.com/z3bra/wendy
# replace below value with path of your chia '-d' value
CHIA_D="/many/t7"
# replace below value with path of HDD
FINAL="/mnt/plots"
wendy -v -m 128 -w $CHIA_D/ \
bash -c 'echo "Acquired land! Fencing in $(basename $WENDY_INODE) . . ." && mv $CHIA_D/$(basename $WENDY_INODE) $FINAL/ && [[ -f $FINAL/$(basename $WENDY_INODE) ]] && echo "$(basename $WENDY_INODE) is ready for farming!"' | \
systemd-cat -t landBureau &
@wallentx
Copy link
Author

When any file that is in the $CHIA_D path gets renamed (inotify event 128), it triggers the command to:

  • Verify that the file exists (might be unnecessary, but felt like it couldn't hurt to do an additional logic check)
  • Move the file to $FINAL

If $CHIA_D is a SSD - ideally one that is dedicated for -d - then this will speed up the last part of the plot job, and unblock chia from moving on to subsequent -n jobs. Meanwhile, another process is executed that moves the plot from your SSD to your HDD. It might not be super fast, but it only needs to complete this faster than you can write plots to the drive that would exceed it's total capacity

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