How to avoid renaming already renamed files w/DateTime stamp
Posted: Wed Feb 16, 2022 6:25 am
Hi all, thanks in advance for any assistance you may provide!
Situation:
1. The source application generates a file like "Inventory.XML" every 10 minutes that gets uploaded to my FTP server.
2. Ten minutes later, the source application will generate a new file named "Inventory.XML", which will overwrite the previously existing file on the FTP server once uploaded
3. I want to keep the previous file on the FTP site and rename it with a dateTime stamp so that it is not overwritten by a subsequent FTP transfer of a file with the same name
Requests:
1. How do I apply a dateTime stamp Suffix to just those files that don't already have one?
a. Note, using BRU section 8 "Auto Date" Suffix mode with Format YMD HMS works fine for the first pass, but then keeps appending dates to the filename on each subsequent pass, so I figure I need to apply a Regex or Mask, etc., which is what I need help with.
2. How do I schedule BRU to apply this routine automatically?
Desired Result Example:
10am - Inventory.XML is uploaded to FTP site
10:01am - BRU renames Inventory.XML to Inventory20220215100103.XML
10:10am - new Inventory.XML is uploaded to FTP site
10:11am - BRU skips Inventory20220215100103.XML (i.e. leaves the filename intact because is already has the dateTime suffix) AND renames the new Inventory.XML to Inventory20220215101101.XML
10:20am - new Inventory.XML is uploaded to FTP site
10:21am - BRU leaves the two existing filenames intact, but renames the third Inventory.XML to Inventory20220215102159.xml
So, in this example I would wind up with three "Inventory" files each with only one instance of the dateTime suffix.
Situation:
1. The source application generates a file like "Inventory.XML" every 10 minutes that gets uploaded to my FTP server.
2. Ten minutes later, the source application will generate a new file named "Inventory.XML", which will overwrite the previously existing file on the FTP server once uploaded
3. I want to keep the previous file on the FTP site and rename it with a dateTime stamp so that it is not overwritten by a subsequent FTP transfer of a file with the same name
Requests:
1. How do I apply a dateTime stamp Suffix to just those files that don't already have one?
a. Note, using BRU section 8 "Auto Date" Suffix mode with Format YMD HMS works fine for the first pass, but then keeps appending dates to the filename on each subsequent pass, so I figure I need to apply a Regex or Mask, etc., which is what I need help with.
2. How do I schedule BRU to apply this routine automatically?
Desired Result Example:
10am - Inventory.XML is uploaded to FTP site
10:01am - BRU renames Inventory.XML to Inventory20220215100103.XML
10:10am - new Inventory.XML is uploaded to FTP site
10:11am - BRU skips Inventory20220215100103.XML (i.e. leaves the filename intact because is already has the dateTime suffix) AND renames the new Inventory.XML to Inventory20220215101101.XML
10:20am - new Inventory.XML is uploaded to FTP site
10:21am - BRU leaves the two existing filenames intact, but renames the third Inventory.XML to Inventory20220215102159.xml
So, in this example I would wind up with three "Inventory" files each with only one instance of the dateTime suffix.