-3
我已經創建了這個腳本來上傳一個帶有python的文本文件,但是現在我想要修改這個腳本來每5分鐘上傳一次這個文件。我怎樣才能做到這一點?循環一個腳本並每5分鐘上傳一個文件
import ftplib
import win32api
import os
sftp = ftplib.FTP('ftp.microsoft.com','test','test') # Connect
sftp.cwd("test")
fp = open('test.txt','rb') # file to send
sftp.storbinary('test.txt', fp) # Send the file
fp.close() # Close file and FTP
sftp.quit()
使用cron http://www.thegeekstuff.com/2011/07/cron-every-5-minutes/ – Mateusz