restart.sh with console logs with timestamp and binary file copy (for GDB)
#!/bin/bash ulimit -c unlimited while true; do cp kasteria bins/kasteria_`date '+%Y-%m-%d_%H-%M'`_`crc32 kasteria` stdbuf -o 0 ./kasteria 2>&1 | ts '%Y-%m-%d_%H-%M-%.S' | tee -a 'console/console_'`date '+%Y-%m-%d'`'.log'; echo START SLEEP FOR 3 SECONDS, PRESS CTRL+C TO TURN OFF RESTARTER sleep 3 echo END SLEEP done