[SOLVED] How to get the date of the last sync job (CLI) [SOLVED]

Calogero Lo Leggio

Active Member
Jan 12, 2017
4
0
41
44
Hi,

Is there a way to get the last sync job, of a specific datastore, from the command line?

I need this information to implement a monitoring system different from the integrated one that uses the email.


Thanks!
 
Sorry but I only find "verification job" not sync job.

This is what I do:
curl -k -H 'Authorization: PBSAPIToken=X' https://NODE:8007/api2/json/nodes/NODE/tasks | jq

output:
Code:
{
  "data": [
    {
      "endtime": 1632760892,
      "node": "localhost",
      "pid": 219153,
      "pstart": 270099,
      "starttime": 1632646800,
      "status": "OK",
      "upid": "UPID:matrix3:00035811:00041F13:00000021:61503690:verificationjob:pbs\\x2dext\\x3av\\x2da313dfae\\x2d172b:root@pam:",
      "user": "root@pam",
      "worker_id": "pbs-ext:v-a313dfae-172b",
      "worker_type": "verificationjob"
    },
    {
      "endtime": 1632113533,
      "node": "localhost",
      "pid": 2417,
      "pstart": 6969,
      "starttime": 1632042000,
      "status": "OK",
      "upid": "UPID:matrix3:00000971:00001B39:00000087:6146FC10:verificationjob:pbs\\x2dext\\x3av\\x2da313dfae\\x2d172b:root@pam:",
      "user": "root@pam",
      "worker_id": "pbs-ext:v-a313dfae-172b",
      "worker_type": "verificationjob"
    },
 ....


Am I doing something wrong?
 
Last edited:
by default it will only show you 50 tasks - see the API description.
 
Oops.
Thanks!

I finally managed to get the latest syncjobs since yesterday.

Maybe it can be useful to someone:
Bash:
export yesterday=$(date -d "now - 1 day" +'%s')

# sync job since yesterday
curl -s -k -H 'Authorization: PBSAPIToken=X' https://NODE:8007/api2/json/nodes/NODE/tasks\?typefilter=syncjob\&since=${yesterday} | jq .total