Start a new topic
Answered

Find Filter question

essupport @ Tue Feb 04 04:48:09 EET 2014
Hi ,

I'm testing a Crushtask for finding files in a directory with Find filter parameters.
some example of files are :

- TGM_20131023111225.txt
- TGM_20131023091225-092058.[b]txt[/b]
- TGM0001131010.[b]pdf[/b]
- TGM_20131014131250.txt.[b]arch[/b]

It works fine if I use :

*.pdf
*.txt

but if I want to filter on TGM*.* or TGM*.txt , the task gives errors and find no files at all.
I can't remember exactly , but i think this worked before upgrading from Version 6.4.0_4 to the current Version 6.4.0_133.

Is there a way to filter with ex. TGM*.* or TGM*.txt ?

Thanks
Mario

Best Answer
spinkb @ Tue Feb 04 04:50:25 EET 2014
The filter is not on the filename.

Its on the file URL.

file://myfiles/folder/stuff/TGM_20131023112525.txt

So your filter needs to be: */TGM*.txt

Thanks,
Ben

Answer
spinkb @ Tue Feb 04 04:50:25 EET 2014
The filter is not on the filename.

Its on the file URL.

file://myfiles/folder/stuff/TGM_20131023112525.txt

So your filter needs to be: */TGM*.txt

Thanks,
Ben
essupport @ Tue Feb 04 05:25:17 EET 2014
Hi Ben ,

Thank you to clarify the filtering.
Just tested as described and works fine.

Thanks !!
Mario

I just spent a good hour trying to work out why my task was not finding the files in my directory for the same reason stated above.


I suspect most users would not expect to put a */ in front of their find filter as this is not how most find filters work.


Do you think it would be possible to have the */ added automatically in the background if it does not exist on the find filter already?    This might make it more convenient (and harder to get wrong) when doing simple searches on a path.


Regards,

Rohan.

We'll get some UI element updated to better reflect its on the URL.

I know I am commenting on a rather old post, but try anyways..


I am trying to find files within different directories where the files can be anything (.txt/.xml/.csv/etc).

Currently I have one user that can upload in lots of different directories with the following structure; /customers/customername/in where customername varies. My current configuration uses {parent_path} as the FIND URL setting. This actually recognizes the /in directory where the file is uploaded to. My FILE FILTER setting is */* (because I want which ever file it can find). 


When I upload a file to the preferred */in/ directory, I get the following lines in the log file;


26711 GENERAL|01/20/2016 11:53:01.875|tasks.FindTask.Find:Starting...

26712 GENERAL|01/20/2016 11:53:01.893|tasks.FindTask.Find:Finding items in path:/janssen/JA002/in/

26713 GENERAL|01/20/2016 11:53:01.973|tasks.FindTask.Find:(1) Getting list for /janssen/JA002/in/

26714 GENERAL|01/20/2016 11:53:01.973|tasks.FindTask.Find:Job task:__janssen_012016115301870:wAtoRt4JsIEMfWiLkJWI

26715 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:java.io.FileNotFoundException: No such item:/janssen/JA002/in

26716 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:com.crushftp.client.FileClient.list:135

26717 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:tasks.FindTask.getList:469

26718 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:tasks.FindTask.run:118

26719 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:tasks.Task.go:148

26720 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:CrushTask.Start$2.run:575

26721 GENERAL|01/20/2016 11:53:01.974|tasks.FindTask.Find:java.lang.Thread.run:745


How do I configure the Find task to successfully find all types of files within the different /in/ directories?


Regards,

Martijn


If you triggered this from an event in the User Manager, why re you doing a Find?  The list of uploaded files is passed into the Task when its run, so it knows all items that were uploaded.

Hi Ben,


I am new to CrushFTP since yesterday. It works when I use an event that checks on 'Upload in any directory'. Eventhough premissions should always be set correctly, I do not want to risk the process to be kicked off when the user accidentally uploads in any other directory than the */in directory. How do I ensure that the event only checks on all the */in directories? Using a * under 'Upload in below directory' doesn't work. That's why I tried using a Find action within the event. It's very likely I am approaching this the wrong way. If that's the case, please point me into the right direction.


regards,

Martijn

In the event, select uploads in below directory, and choose /in/


Its not pattern matching there as its just ensuring the path starts with what you enter in there.


--Ben

I tried that, but that's not picking anything up. The FTP user enters its home directory where there are 60 directories and under those directories there are /in and /out (and other) directories;


<home_dir>/<customer_id>/in/

<home_dir>/<customer_id>/whatever_other_dirs/


So with /in/ alone it won't pick up anything because the customer_id directory is still above it. This user needs to upload to different customer folders. Being it 60 different ID's, I can't hard code that into the path.


On a different FTP user, I indeed used just /in/ because that folder is directly under that user's home directory.


Regards,

Martijn

OK, then do all in he event.  In your task then, for the copy task, or other tasks that you don't want to apply to all dirs, set the filter at the top of the last to be */in/*


--Ben

Login to post a comment