I wish to run a command for the longest period possible and kill it at a certain absolute time (if it is still running), something like:
killat "2018-06-09_23:55" ./myscript.bash
The resources I've found relate to killing processes at a time relative to the start time.
timeout command takes an argument for the numbers of seconds after which to kill the process, but this is also relative to the start time. One solution would be to calculate the difference between now and the desired time and pass that to
Another way might be to set up a one-off
cron job at the required time that looks for a recorded PID and send a kill signal.
Are there any purpose build alternatives to this?