0

I would like to make a script to upload files to a ftp

This file should be uploaded one time per day to a specific time.

  1. erp software creates those files 3 times per day (1. at 9am, 2. at 1pm, 3. at 5pm)
  2. Files are stored to specific folder on ERP server (windows server 2019) with a changing filename(includes timestamp) f.e. =stockkeeping_270121_1700 / stockkeeping_260121_1300
  3. I only want to upload the file from 5pm to the ftp, so the script should ignore the files that are created before.
  4. As filenames differ, I have to make a script which uses the file directory, rather than the file-name.

any idea? I discovered that python & ftplib can be used to upload files to ftp, but I'm not sure if this can fulfill this special requirements.

br mehlo

  • 1
    If I understand your question right, it should be suitable for you to just scan the directory and upload the 'newest' file. You can automate such a task with the windows task scheduler. For python execution with the task scheduler see: https://stackoverflow.com/questions/44727232/scheduling-a-py-file-on-task-scheduler-in-windows-10 – ag00se Jan 27 '21 at 07:45
  • 1
    A similar problem, using windows .batch files, is available here: https://stackoverflow.com/questions/39971561/windows-batch-file-upload-only-latest-file-to-ftp – ag00se Jan 27 '21 at 07:50
  • Your question is quite vague and broad. You might want to narrow down the question to something like *"How to upload the latest file to FTP in Python?"* – If you really need to use Python. Or use the batch file solution suggested by @JK. – Martin Prikryl Jan 27 '21 at 09:57

0 Answers0