CTMFW with wild card and file size

Everything about Control-M agents installation or setup.
Post Reply
User avatar
Deano
Nouveau
Nouveau
Posts: 42
Joined: 03 Jul 2006 12:00
Location: London´

CTMFW with wild card and file size

Post by Deano » 23 Apr 2007 5:02

Hi, I am performing a file watch on a file that contains a wild card:-

ctmfw "E:\Interfaces\tmp\axa_to_jpm_fx_q_to_file*.txt" CREATE 1 1 3 3 10 Y

I want the job to fail unless the file it finds is at least 1 byte in size.

I have read that by adding the Y at the end of the command line, that it will take size into account, but this is not working.

Any ideas? :?:

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 24 Apr 2007 5:14

Hi,

Ctmfw and wilcard run together only to test file creation.
Try again with simple quote.

ctmfw 'E:\Interfaces\tmp\axa_to_jpm_fx_q_to_file*.txt' CREATE 1 1 3 3 10 Y

User avatar
Deano
Nouveau
Nouveau
Posts: 42
Joined: 03 Jul 2006 12:00
Location: London´

Post by Deano » 25 Apr 2007 11:49

Many thanks.

I tried again using the single quotes and it worked fine. Even taking the size into the equation.

Deano

User avatar
Deano
Nouveau
Nouveau
Posts: 42
Joined: 03 Jul 2006 12:00
Location: London´

Post by Deano » 02 May 2007 10:15

Oops! This only half works!!

The command above will fail if a 0 byte file is detected, but will not complete successfully if a file of 1 byte or greater is detected.

So, unfortunately, this is not a solution. It looks like a command file is the only way to perform this task.

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 24 Jul 2007 7:06

From the ctmfw documentation for CREATE mode:

"Detects creation of a file. Default. File size is ignored if the filename
parameter contains wildcards (unless the monitor file size when
wildcard is used parameter is set to Y).

Note: If a mask is specified for the filename, and the monitor file size
when wildcard is used parameter is set to
■ N, the ctmfw utility will end OK after detection of the first file that
matches the specified mask.
■ Y, the ctmfw utility will end OK after detection of the first file that
matches the filename and file size. "

and more:
"If this parameter is set to Y and more than one file matches the specified mask, the ctmfw utility randomly selects one matching file, monitors its file size, and ignores all other matching files."

The monitor of the creation and the size works only for the FIRST file, the others are not monitored. This can be your problem like was for me.
If you want to monitor the creation and the size grow of all the files, you must run the utility for all the files.

User avatar
Hawkes852
Nouveau
Nouveau
Posts: 1
Joined: 15 Jan 2011 12:00

Post by Hawkes852 » 15 Jan 2011 7:29

Wonderful post...

User avatar
ahtisham454
Nouveau
Nouveau
Posts: 23
Joined: 16 Feb 2012 12:00

Post by ahtisham454 » 16 Feb 2012 12:26

A really nice idea. I appreciate it much !

User avatar
soli032
Nouveau
Nouveau
Posts: 1
Joined: 08 Jan 2013 12:00

Post by soli032 » 08 Jan 2013 7:04

Hi thanks for share awesome ideas keep it up

Post Reply