Personally I would prefer to have the process creating the backup naming it with a datestamp in the filename.
But it is also possible to rename the file before uploading it to the FTP. When I need to rename files I use a SystemCaller and a DOS command.
- Creator to initiate process.
- FeatureReader (Directory and File Pathnames) to look in the folder for the .bak file.
- Under Parameters, set Retrieve file properties to Yes to get the path_created_date attribute.
- AttributeCreator
- create _filename_new using @Left(@Value(path_created_date),8).bak, this creates a filename like 20240528.bak
- create _path_windows_new using @ReplaceString(@Value(path_windows),@Value(path_filename),@Value(path_filename_new)),
- SystemCaller to rename the file
- rename "@Value(path_windows)" @Value(_filename_new)
- set ExitCodeAttribute.
- Tester to check is ExitCodeAttribute = 0.
- FTPCaller to upload the renamed file.
An alternative is to use the FeatureWriter (FileCopy) to rename the file, but must find the SystemCaller easier to work with.