justanhduc / task-spooler

A scheduler for GPU/CPU tasks
https://justanhduc.github.io/2021/02/03/Task-Spooler.html
GNU General Public License v2.0
273 stars 24 forks source link

Unable to redirect output from command line #48

Open gauthier12 opened 1 year ago

gauthier12 commented 1 year ago

Hello. I would like to redirect the output of my command launched by task-spooler. I've seen comments using stdout redirection of the job but I haven't been able to use it. I use ts "./test.sh > test.log but the output is still stored in a temporary file in /tmp. I've tried with a absolute path and with the tee command and still nothing. The -o file option still output with a random suffix in /tmp. The only way I've found is to create a temporary script and redirect the output from inside the script. Is there something I am missing ? Cheers

justanhduc commented 1 year ago

Hey @gauthier12. Sorry for the late reply. The way I see it, you need --set_logdir first and then use -O for the output file. Or am I missing something?

gauthier12 commented 1 year ago

Hi, thanks for the response. The -O option still add a random name on the file and the --set_logdir change the server environnement so I'm not sure but the --set_logdir option can change the output directory of previously queued job still pending. I've got a workaround by patching execute.c to output in the current directory and without the random part but I would prefer to work with the common redirection in the command line ( ts "./test.sh > test.log" ), it would be simpler for my users.