X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=paralleljobs.py;h=cb4a0691da479eed4ef87da1255951a22e17f484;hb=d073e6e6b6af04799080b004a6cf2dbed12a96c3;hp=baf79651b101056abf7eb20513c73303e8cbf695;hpb=c9ac24f37d75d103df68fefde3d5cfe88d0ea939;p=paralleljobs.git diff --git a/paralleljobs.py b/paralleljobs.py index baf7965..cb4a069 100755 --- a/paralleljobs.py +++ b/paralleljobs.py @@ -66,12 +66,13 @@ def runCmd(cmd): return exitcode, out, err def processJob(conn, jobid): - print("Process job %d" % (jobid)) c = conn.cursor() c.execute("SELECT cmd FROM jobs WHERE id=?", (jobid,)) cmd, = c.fetchone() + print("Process job %d: %s" % (jobid, cmd)) + ec, out, err = runCmd(cmd) c.execute("UPDATE jobs SET exitcode=?, done=1 WHERE id=?;", (ec, jobid)) @@ -168,7 +169,7 @@ OPTIONS: -d database the database to process -n num in -w mode, only perform num-many jobs -p cols-def create properties table with SQL column spec - -v print output of the job's command + -v verbose output Commands may be combined in one call of {0}.