Folder monitoring and calling a script

Discuss RoboTask here
Post Reply
ann_l
Posts: 3
Joined: Thu Sep 28, 2006 3:44 am

Folder monitoring and calling a script

Post by ann_l »


I want a task to be set to watch for new files / folders in a
particular directory. Whenever a new file is dropped in the particular
directory, some commandline scripts should run automatically. Can
anyone help me out in achieving this.

Thanks,
Ann.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Folder monitoring and calling a script

Post by Oleg »

You can make such task with using "File monitor" triggering event.
How to use file monitor you can see in the following examples:
File monitor demo 1.tsk - this task monotores the folder c:\incomong and enumerates new files when they arrived.
Show -Folder Changed-.tsk - this task monitores all changes in folder c:\temp and shows the list of new files, changed files, and deleted files in the folder when changes was happened.

Alse you can find more examples here

Save the task into the file and use menu "Task | Import" to import into RoboTask. Don't forget to enable each task after importing
ann_l
Posts: 3
Joined: Thu Sep 28, 2006 3:44 am

Folder monitoring and calling a script

Post by ann_l »

Thanks for you reply. I dont find any examples of how to intitiate a script from commandline through robotask.My requirement is when a new folder/file arrives, i wanted a script to run from the commandline.Also, is there any tool similar to robotask for linux. Any ideas on how file monitoring can be done in linux.
Last edited by ann_l on Fri Sep 29, 2006 1:35 am, edited 1 time in total.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Folder monitoring and calling a script

Post by Oleg »

What script did you mean? VB-script or something else? Describe in more detail, please.

You can start all command-line utilities by "Run program/Open document" action.
ann_l
Posts: 3
Joined: Thu Sep 28, 2006 3:44 am

Folder monitoring and calling a script

Post by ann_l »

I wanted to run a php script whnever a new file is dropped in a particular directory. Something like below:php callscript.php arg1 arg2
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Folder monitoring and calling a script

Post by Oleg »

What is the problem?

Use "Run program/Open document" action and write the following:
php - into "Program or Document name" ("php" is a command-line interpreter of php scripts. Isn't it?)
callscript.php arg1 arg2 - into "Parameters"

Also, I think, that you must specify the full path to callscript.php (e.g. "c:\my folder\scripts\callscript.php")
Post Reply