File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -483,8 +483,7 @@ def run_prefect_db_backup():
483483 ts = datetime .now (timezone .utc ).strftime ("%Y-%m-%dT%H%M%SZ" )
484484 OUTDIR = Path .home () / "prefect-backups"
485485 OUTDIR .mkdir (parents = True , exist_ok = True )
486- db_file_name = f"prefect-{ ts } .sql"
487- db_backup = OUTDIR / db_file_name
486+ db_backup = OUTDIR / f"prefect-{ ts } .sql"
488487
489488 cmd = ["bash" , bkpscript , str (db_backup )]
490489 result = subprocess .run (cmd , capture_output = True , text = True )
@@ -504,14 +503,9 @@ def run_prefect_db_backup():
504503 )
505504 # --- Copy to CANFAR ---
506505 print ("Copying the backup to CANFAR..." )
507- try :
508- client = Client ()
509- VOS_FOLDER = "arc:projects/CIRADA/polarimetry/software/prefect-backups"
510- remote_file = f"{ VOS_FOLDER } /{ db_file_name } "
511- client .copy (str (db_backup ), remote_file )
512- print ("Backup completed successfully" )
513- except Exception as e :
514- print (f"Failed to copy backup to CANFAR: { e } " )
506+ client = Client ()
507+ client .copy (str (db_backup ), "arc:projects/CIRADA/polarimetry/software/prefect-backups" )
508+ print ("Backup completed successfully" )
515509
516510if __name__ == "__main__" :
517511 parser = argparse .ArgumentParser (
You can’t perform that action at this time.
0 commit comments