3 ms·
'tail' is so neat and versatile. I used it as a solution to allow me to trigger backups of minecraft worlds from within the game server my son and I share. Any
by DubiousPusher 5y ago
'tail' is so neat and versatile.
I used it as a solution to allow me to trigger backups of minecraft worlds from within the game server my son and I share. Anything you put to the 'say' command is written to the game's log. I use
tail -F -n 0 ./logs/latest.log | grep --line-buffer <command-pattern> | sudo xargs -L1 ./some_script.bsh
to detect commands in the log and shuttle them to a custom script. In my case it zips a copy of the world and pushes it to blob storage.
I'm not a unix guy so figuring this all out was quite gratifying.