I have a python script (v3.8) that gets a file once per day from an FTP Server and I want to add the timestamp of the file's creation date at the server when I save it locally.
My code so far:
from ftplib import FTP
ftp = FTP(host)
ftp.login(username,password)
ftp.cwd('/')
ftp.retrbinary('RETR ' + 'name_of_file.csv', f.write)
f = open('D:/myFolder/name_of_file.csv','wb')
ftp.quit()
ftp.close()
With the above code I save a csv copy in "myFolder" every day, but If I don't add the timestamp , each file will be overwritten the Next morning.
Desired output: name_of_file_DDMMYYYY_HH_MM.csv