Score:0

at jobs don't clear the queue even when completed?

mt flag
MKF

I have some very simple python code that sets up a job queue, piping to the linux batch command:

import subprocess

for j in range(1,17):
  process = subprocess.Popen('/bin/sh', '-c', f'python test.py {j} | batch')
  process.communicate()
  print(process.returncode)

When I run this, the print(process.returncode) line prints 0 which means success.

The script being called in the subprocess, test.py, just writes a quick txt file so nothing resource consuming:

import sys

with open(f'{sys.argv[1]}.txt', 'w') as f:
    f.write('hello')

This code creates 16 jobs and appears to run them all at once (batch is kinda pointless in what I'm doing at the moment since the server never reaches a load where it needs to queue jobs, but I'm just learning right now). Immediately after running it, when I type atq in the terminal, I can see that none of the jobs are running (no = or b), but they also don't clear the queue despite the seeming success given that they write the text files and give me a returncode of 0. What could be the reason for them to not clear the queue? If it's a hidden error, how would I go about getting that output?

57      Wed Aug 16 18:37:00 2023
48      Wed Aug 16 18:37:00 2023
58      Wed Aug 16 18:37:00 2023
49      Wed Aug 16 18:37:00 2023
56      Wed Aug 16 18:37:00 2023
60      Wed Aug 16 18:37:00 2023
51      Wed Aug 16 18:37:00 2023
59      Wed Aug 16 18:37:00 2023
50      Wed Aug 16 18:37:00 2023
55      Wed Aug 16 18:37:00 2023
54      Wed Aug 16 18:37:00 2023
47      Wed Aug 16 18:37:00 2023
52      Wed Aug 16 18:37:00 2023
61      Wed Aug 16 18:37:00 2023
53      Wed Aug 16 18:37:00 2023
62      Wed Aug 16 18:37:00 2023
...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.