Please try the below as execjob_epilogue hook:
f=open(â/tmp/abc.txtâ, âw+â)
f.write("======================================================================================\n\n\t\t\tResource Usage on %s:\n\nJobId: %s \n\tJob_Name = %s \n\tJob_Owner = %s \n\tresource_used.cpupercent = %s \n\tresource_used.cput = %s \n\tresources_used.mem = %s \n\tresources_used.ncpus = %s \n\tresources_used.vmem = %s \n\tresources_used.walltime = %s \n\tqueue = %s \n\tserver = %s \n\tAccount_Name = %s \n\tError_Path = %s \n\texec_host = %s \n\texec_vnode = %s \n\tJoin_Path = %s \n\tKeep_Files = %s \n\tOutput_Path = %s \n\tRerunable = %s \n\tResource_List.ncpus = %s \n\tResource_List.nodect = %s \n\tResource_List.place = %s \n\tResource_List.mem = %s \n\tResource_List.cput = %s\n\tResource_List.walltime = %s \n\tjobdir = %s \n\tEnvironment_Variables = PBS_O_SYSTEM=%s,PBS_O_SHELL=%s,PBS_O_HOME=%s,PBS_O_LOGNAME=%s,PBS_O_WORKDIR=%s,PBS_O_LANG=%s,PBS_O_PATH=%s,PBS_O_QUEUE=%s,PBS_O_HOST=%s \n\teuser = %s \n\tegroup = %s \n\trun_count = %s \n\t\n======================================================================================\n" % (str(datetime.datetime.now()),ji,j.Job_Name,j.Job_Owner,j.resources_used.cpupercent,j.resources_used.cput,j.resources_used.mem,j.resources_used.ncpus,j.resources_used.vmem,j.resources_used.walltime,j.queue,j.server,j.Account_Name,j.Error_Path,j.exec_host2,j.exec_vnode,j.Join_Path,j.Keep_Files,j.Output_Path,j.Rerunable,j.Resource_List[âncpusâ],j.Resource_List[ânodectâ],j.Resource_List[âplaceâ],j.Resource_List[âmemâ],j.Resource_List[âcputâ],j.Resource_List[âwalltimeâ],j.jobdir,j.Variable_List[âPBS_O_SYSTEMâ],j.Variable_List[âPBS_O_SHELLâ],j.Variable_List[âPBS_O_HOMEâ],j.Variable_List[âPBS_O_LOGNAMEâ],j.Variable_List[âPBS_O_WORKDIRâ],j.Variable_List[âPBS_O_LANGâ],j.Variable_List[âPBS_O_PATHâ],j.Variable_List[âPBS_O_QUEUEâ],j.Variable_List[âPBS_O_HOSTâ],j.euser,j.egroup,j.run_count))
f.close()
If you improvise it, please share it with the community