ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Hi,

We are trying to move to a remote directory that uses the format...

Invoices_08-11-2011

Actually the format is not that important we can change it but using the date is a requirment. The issue is how do we identify the current date directory. So that we can move into it. I looked at GETFILETIME but this does not work for directories.

Any ideas would be greatly appreciated.

Thanks

Mark....
Hello Mark,

You need to build manually the directory name corresponding for today. For example:

[scriptftp="today_directory.ftp"]$today_directory_name = "Invoices_".GETTIME(DAY)."-".GETTIME(MONTH)."-".GETTIME(YEAR)

$result=CHDIR($today_directory_name)

IF($result=="OK")
PRINT("Directory for today found")
# Do whatever here like download files, upload new ones etc.
ELSE
PRINT("Directory for today NOT found")
END IF[/ScriptFTP]
Thanks that worked a treat....I also set the date as variables as they are used elsewhere in the script.

Cheers

Mark....