Advertisement
ludolphus

XenBlocks Syncnode scheduled setup

Nov 3rd, 2023 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | Source Code | 0 0
  1. Syncnode service
  2.  
  3. Create a file:
  4.  
  5. nano syncnode.sh
  6.  
  7. and paste following:
  8.  
  9. #!/bin/sh
  10. LOCK=/tmp/syncnode.lock
  11. if [ -f "$LOCK" ]; then
  12. echo "Already running..."
  13. exit 1
  14. fi
  15. touch "$LOCK"
  16. cd /FULL_PATH_TO_SCRIPT
  17. /usr/bin/python3 /FULL_PATH_TO_SCRIPT/syncnode.py YOUR_ADDRESS
  18. /usr/bin/python3 /FULL_PATH_TO_SCRIPT/xenminer/index_builder.py
  19. rm "$LOCK"
  20. exit 0
  21.  
  22. Make syncnode.sh executable:
  23.  
  24. chmod +x syncnode.sh
  25.  
  26. Create a cron job to run this script every 5 minutes
  27.  
  28. Run crontab -e and paste the following
  29.  
  30. */5 * * * * /FULL_PATH_TO_SCRIPT/syncnode.sh
  31.  
  32. The syncnode.lock file will prevent the python scripts from running multiple times at the same time.
  33.  
  34.  
Tags: xen xenblocks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement