2021.06.10 01:00 PM
2021.08.13 06:26 AM
I copied this answer from your other question:
Hello Angela,
In your cronjob, you can start a script like;
0 12 * * * sh /<path-to-your-script>/<your-script>.sh >> <path-to-your-output-log>/cronout.log 2>&1 &
Then in this script file you can go with something like this;
#!/usr/bin/env bash
. <any-source-or-config-file-you-need-in-your-q-process>
cd <to-your-q-script-folder>
/home/<your-user>/q/l64/q <your-q-script>.q > <your-log-file-location>_$(date +'%Y.%m.%dT%H:%M:%S').log 2>&1 &
Notice the ampersand at the end; that ampersand will keep your process alive until you explicitly call exit in your q script.
Hope this helps.
2023.07.12 07:26 PM
I have same issue, it is more sort of any q with timer running in background. My guess is timer task runs in different thread while q REPL or main execution is in thread which remains alive only while a terminal remains associated. When I run in background, main execution sequence ends and timer task becomes meaning less. It executes just one task and stops. Someone from q/kdb+ expert can give correct solution. I tried daemonization at https://code.kx.com/q/kb/daemon/ and that has no change in behavior with timer in q
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.