I have the below code which saves a file and then SFTP's it to another location.
This works fine, but when I scheduled the "Always on" task, it seems to save, but not SFTP.
Any suggestions here?
SAVE AND SFTP
fname = '/home/username/myfolder/myfile.json' try: with open(fname, 'w') as f: json.dump(opportunity_array, f) except: pass #print("File saving error") # sftp files to remote server try: sftp_upload(fname) #print("sftp successful") except: pass #print("sftp error")