Skip to main content
1-Visitor
March 23, 2016
Question

file reaper implementation

  • March 23, 2016
  • 2 replies
  • 2633 views

I need to implement a file reaper on my linux thingworx platform.
for example, files that live under /ThingworxStorage/repository/SystemRepository
that are older that 2 weeks need to be removed.

what are ways about going about that?  I don't think it's feasable to
do that from each ems that runs and connects to the platform ( mashup location )
ideas?

thanks

2 replies

1-Visitor
March 23, 2016

If it's a folder on a TW server system repository, just create a Timer Thing that triggers for instance once a day and deletes old files.

ravila1-VisitorAuthor
1-Visitor
March 23, 2016

ok, i figured out the timer and looked at a scheduler too.

i cannot figure our from the subscription or service features how to call

a bash script without going through php - that seems sloppy.

how can i invoke a bash script direct from a subscription or service to do the job of file clean up?

if that is the wrong way to do it, how can i query the file repository and remove files within a given date range?

1-Visitor
March 23, 2016

You can delete and list files through FileRepository Services:

  • ListFiles
  • DeleteFile

You don't need to use a bash script neither a external php, all done through standard TW features.

ravila1-VisitorAuthor
1-Visitor
March 23, 2016

elegant, thanks.