6767BHOST = PgLOG .PGLOG ['BACKUPNM' ]
6868DHOST = PgLOG .PGLOG ['DRDATANM' ]
6969OBJCTCMD = "isd_s3_cli"
70- BACKCMD = "dsglobus"
70+ BACKCMD = "dsglobus"
7171
7272HLIMIT = 0 # HTAR file count limit
7373BLIMIT = 2 # minimum back tar file size in DB
@@ -338,17 +338,28 @@ def local_copy_object(tofile, fromfile, bucket = None, meta = None, logact = 0):
338338def quasar_multiple_trasnfer (tofiles , fromfiles , topoint , frompoint , logact = 0 ):
339339
340340 ret = PgLOG .FAILURE
341- qstr = '{"action":"transfer","label":"%s","verify_checksum":true,' % ENDPOINTS [topoint ]
342- # qstr = '{"action":"transfer","label":"%s",' % ENDPOINTS[topoint]
343- qstr += '"source_endpoint":"%s","destination_endpoint":"%s","files":[\n ' % (frompoint , topoint )
341+
344342 fcnt = len (fromfiles )
345- bstr = ''
343+ transfer_files = { "files" : []}
346344 for i in range (fcnt ):
347- qstr += '%s{"source_file":"%s","destination_file":"%s"}' % (bstr , fromfiles [i ], tofiles [i ])
348- if i == 0 : bstr = ',\n '
349- qstr += ']}'
350-
351- task = submit_globus_task (BACKCMD , topoint , logact , qstr )
345+ transfer_files ["files" ].append ({
346+ "source_file" : fromfiles [i ],
347+ "destination_file" : tofiles [i ]
348+ })
349+ qstr = json .dumps (transfer_files )
350+
351+ action = 'transfer'
352+ source_endpoint = frompoint
353+ destination_endpoint = topoint
354+ label = f"{ ENDPOINTS [frompoint ]} to { ENDPOINTS [topoint ]} { action } "
355+ verify_checksum = True
356+
357+ cmd = f'{ BACKCMD } { action } -se { source_endpoint } -de { destination_endpoint } --label "{ label } "'
358+ if verify_checksum :
359+ cmd += ' -vc'
360+ cmd += ' --batch -'
361+
362+ task = submit_globus_task (cmd , topoint , logact , qstr )
352363 if task ['stat' ] == 'S' :
353364 ret = PgLOG .SUCCESS
354365 elif task ['stat' ] == 'A' :
@@ -379,7 +390,9 @@ def endpoint_copy_endpoint(tofile, fromfile, topoint, frompoint, logact = 0):
379390 if tinfo and tinfo ['data_size' ] > 0 :
380391 return PgLOG .pglog ("{}-{}: file exists already" .format (topoint , tofile ), logact )
381392
382- cmd = "{} -t -vc -se {} -de {} -sf {} -df {}" .format (BACKCMD , frompoint , topoint , fromfile , tofile )
393+ action = 'transfer'
394+ cmd = f'{ BACKCMD } { action } -se { frompoint } -de { topoint } -sf { fromfile } -df { tofile } -vc'
395+
383396 task = submit_globus_task (cmd , topoint , logact )
384397 if task ['stat' ] == 'S' :
385398 ret = PgLOG .SUCCESS
@@ -435,7 +448,8 @@ def check_globus_status(taskid, endpoint = None, logact = 0):
435448 if not taskid : return ret
436449 if not endpoint : endpoint = PgLOG .PGLOG ['BACKUPEP' ]
437450 mp = r'Status:\s+({})' .format ('|' .join (QSTATS .values ()))
438- cmd = "{} -gt --task-id {}" .format (BACKCMD , taskid )
451+
452+ cmd = f"{ BACKCMD } get-task { taskid } "
439453 astats = ['OK' , 'Queued' ]
440454
441455 for loop in range (2 ):
@@ -452,7 +466,7 @@ def check_globus_status(taskid, endpoint = None, logact = 0):
452466 if logact & PgLOG .NOWAIT :
453467 errmsg = "{}: Cancel Task due to {}:\n {}" .format (taskid , detail , buf )
454468 errlog (errmsg , 'B' , 1 , logact )
455- ccmd = "{} -ct -- task-id {}" . format ( BACKCMD , taskid )
469+ ccmd = f" { BACKCMD } cancel- task { taskid } "
456470 PgLOG .pgsystem (ccmd , logact , 7 )
457471 else :
458472 time .sleep (PgSIG .PGSIG ['ETIME' ])
@@ -759,7 +773,7 @@ def delete_backup_file(file, endpoint = None, logact = 0):
759773 info = check_backup_file (file , endpoint , 0 , logact )
760774 if not info : return PgLOG .FAILURE
761775
762- cmd = "{} -d -ep {} -tf {}" . format ( BACKCMD , endpoint , file )
776+ cmd = f" { BACKCMD } delete -ep { endpoint } -tf { file } "
763777 task = submit_globus_task (cmd , endpoint , logact )
764778 if task ['stat' ] == 'S' :
765779 return PgLOG .SUCCESS
@@ -1028,7 +1042,7 @@ def move_backup_file(tofile, fromfile, endpoint = None, logact = 0):
10281042 elif tinfo != None :
10291043 return ret
10301044
1031- cmd = "{} -- rename -ep {} --oldpath { } --newpath {}" . format ( BACKCMD , endpoint , fromfile , tofile )
1045+ cmd = f" { BACKCMD } rename -ep { endpoint } --old-path { fromfile } --new-path { tofile } "
10321046 loop = 0
10331047 while loop < 2 :
10341048 buf = PgLOG .pgsystem (cmd , logact , CMDRET )
@@ -1158,7 +1172,7 @@ def make_one_backup_directory(dir, odir, endpoint = None, logact = 0):
11581172 if not odir : odir = dir
11591173 if not make_one_backup_directory (op .dirname (dir ), odir , endpoint , logact ): return PgLOG .FAILURE
11601174
1161- cmd = "{} -- mkdir -ep {} -p {}" . format ( BACKCMD , endpoint , dir )
1175+ cmd = f" { BACKCMD } mkdir -ep { endpoint } -p { dir } "
11621176 for loop in range (2 ):
11631177 buf = PgLOG .pgsystem (cmd , logact , CMDRET )
11641178 syserr = PgLOG .PGLOG ['SYSERR' ]
@@ -1843,7 +1857,7 @@ def check_backup_file(file, endpoint = None, opt = 0, logact = 0):
18431857 if not endpoint : endpoint = PgLOG .PGLOG ['BACKUPEP' ]
18441858 bdir = op .dirname (file )
18451859 bfile = op .basename (file )
1846- cmd = "{} - ls -ep {} -p {} --filter {}" . format ( BACKCMD , endpoint , bdir , bfile )
1860+ cmd = f" { BACKCMD } ls -ep { endpoint } -p { bdir } --filter { bfile } "
18471861 ccnt = loop = 0
18481862 while loop < 2 :
18491863 buf = PgLOG .pgsystem (cmd , logact , CMDRET )
@@ -2208,7 +2222,8 @@ def backup_glob(dir, endpoint = None, opt = 0, logact = 0):
22082222
22092223 if not dir : return None
22102224 if not endpoint : endpoint = PgLOG .PGLOG ['BACKUPEP' ]
2211- cmd = "{} -ls -ep {} -p {}" .format (BACKCMD , endpoint , dir )
2225+
2226+ cmd = f"{ BACKCMD } ls -ep { endpoint } -p { dir } "
22122227 flist = {}
22132228 for loop in range (2 ):
22142229 buf = PgLOG .pgsystem (cmd , logact , CMDRET )
0 commit comments