Hi All,
how can i upload files that are older than two days?
thanks,
how can i upload files that are older than two days?
thanks,
Hi sumation, thanks for posting your question here. Try the following:
FTP Script
- # Connecto to the FTP server
- # Change current remote directory
- # Change current local directory
- # Retrieve current date and time
- # Substract two days (in seconds) from the current date,
- # assign the result to another variable
- $two_days_ago=$current_date_time-(2*24*60*60)
- # Request the remote file list
- # For each file in the current local directory
- # check if it is older than two days. If so upload it
liked Script FTP? Try our other product Email Parser
It works,
one bit of an issue is script uploads other files that are not in the path.
i.e.
what could be the problem.
one bit of an issue is script uploads other files that are not in the path.
i.e.
what could be the problem.
Last edited by sumation on 22 Dec 2014, 21:21, edited 1 time in total.
the problem was that with the following line it was getting almost all the local files and uploading them.
so I removed it.
Thank you for your time and efforts!
FTP Script
Thank you for your time and efforts!
the problem was that with the following line it was getting almost all the local files and uploading them.do you mean that GETLIST was giving you files that were in subfolders? This should not happen unless you use GETLIST(....., SUBDIRS), and it seems that you have not used it. Could you confirm this?
liked Script FTP? Try our other product Email Parser
I was uploading files from all over and i had no subdirectory.
so a commented #GETLIST($local_file_list,LOCAL_FILES) and the problem was solved, Only uploaded what ever as 2 days old with zip ext.
Thanks again !
so a commented #GETLIST($local_file_list,LOCAL_FILES) and the problem was solved, Only uploaded what ever as 2 days old with zip ext.
Thanks again !
thanks for your reply
liked Script FTP? Try our other product Email Parser
- All times are UTC -