FTP is picking up .tmp files too..

Post variable and regex related tips, questions.

FTP is picking up .tmp files too..

Postby Jamie » Fri Oct 25, 2013 10:59 pm

user support request:

I have a FTP process which should only pickup .edi files in a certain folder. After FTP transfer, the source files should be deleted.

Unfortunately, in the same folder there are temporary .edi.tmp files. These are files that are in the process of being generated.

I use .edi for the filename field. Problem is that the task picks up .edi and .edi.tmp files. The .edi.tmp files are partially written and cause a problem. These .tmp files are transferred, but are not deleted after the transfer.

How do I only specify .edi and not .edi.tmp?
Last edited by Jamie on Fri Oct 25, 2013 11:04 pm, edited 2 times in total.
Jamie
Site Admin
 
Posts: 115
Joined: Mon Aug 14, 2006 8:16 am

use Regex \Z switch to match word boundary

Postby Jamie » Fri Oct 25, 2013 11:00 pm

1) You should REGEX format to pick .edi but not .edi.tmp.
In the filename field, use:
REGEXF=[a-zA-Z0-9]{1,}.edi\Z

[a-zA-Z0-9] matches any alphabet or number
{1,} matches 1 or more
.edi matches .edi
\Z is the end of word boundary.. i.e. \Z will pass .edi but will block .edi.tmp

2) The .tmp files are currently being created and write locked. They can be read but not deleted (locked).

3) using the REGEXF above will fix this issue.

4) Another way is to use the option to transfer files which are older than 10-15 minutes.. This way you are sure they are not in the middle of being written to.
Jamie
Site Admin
 
Posts: 115
Joined: Mon Aug 14, 2006 8:16 am


Return to Variables and Regular Expressions

Who is online

Users browsing this forum: No registered users and 1 guest

cron