Welcome! » Log In » Create A New Profile

counting files in directories for a node

Posted by Lee, Gary 
Lee, Gary
counting files in directories for a node
November 16, 2017 07:59AM
Tsm server 7.1.7.100

I have a request to count the number of files in each directory on the e: drive for a node.
For output, path name, and file count.

Any pointers on where to start?

I can do it given a specific path,

Select count(*) from backups where node_name=bla and hl_name=bla and type='FILE'

How to extend this to all dirs. In a filespace?

Thanks for the help.
This message was imported via the External PhorumMail Module
Thomas Denier
Re: counting files in directories for a node
November 16, 2017 07:59AM
You will need something like:

select hl_name,count(ll_name) from backups where node_name='JUPITER' and filespace_id=3 group by hl_name

The "group by" clause triggers the desired counting by directory.

You might be able to use something like "filespace_name='\\jupiter\e$'" as an alternative to the "filespace_id" test; I am not sure whether you would have problems with Unicode characters or not.

Depending on your exact goal, you might need to add "state='ACTIVE_VERSION'" to the selection criteria. If you omit this condition, the counts will include copies of recently deleted files and copies of older versions of recently updated files.

Thomas Denier,
Thomas Jefferson University

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Lee, Gary
Sent: Thursday, November 16, 2017 10:18
To: ADSM-L@VM.MARIST.EDU
Subject: [ADSM-L] counting files in directories for a node

Tsm server 7.1.7.100

I have a request to count the number of files in each directory on the e: drive for a node.
For output, path name, and file count.

Any pointers on where to start?

I can do it given a specific path,

Select count(*) from backups where node_name=bla and hl_name=bla and type='FILE'

How to extend this to all dirs. In a filespace?

Thanks for the help.
The information contained in this transmission contains privileged and confidential information. It is intended only for the use of the person named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

CAUTION: Intended recipients should NOT use email communication for emergent or urgent health care matters.
This message was imported via the External PhorumMail Module
Thomas Denier
Re: counting files in directories for a node
November 16, 2017 07:59AM
My previous response omitted the "type='FILE'", which is needed to get the result you want.

Thomas Denier,
Thomas Jefferson University

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Lee, Gary
Sent: Thursday, November 16, 2017 10:18
To: ADSM-L@VM.MARIST.EDU
Subject: [ADSM-L] counting files in directories for a node

Tsm server 7.1.7.100

I have a request to count the number of files in each directory on the e: drive for a node.
For output, path name, and file count.

Any pointers on where to start?

I can do it given a specific path,

Select count(*) from backups where node_name=bla and hl_name=bla and type='FILE'

How to extend this to all dirs. In a filespace?

Thanks for the help.
The information contained in this transmission contains privileged and confidential information. It is intended only for the use of the person named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

CAUTION: Intended recipients should NOT use email communication for emergent or urgent health care matters.
This message was imported via the External PhorumMail Module
Lee, Gary
Re: counting files in directories for a node
November 16, 2017 08:59AM
That did it. Couldn't remember "group by".

Thank you Thomas.


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Thomas Denier
Sent: Thursday, November 16, 2017 10:55 AM
To: ADSM-L@VM.MARIST.EDU
Subject: Re: [ADSM-L] counting files in directories for a node

My previous response omitted the "type='FILE'", which is needed to get the result you want.

Thomas Denier,
Thomas Jefferson University

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Lee, Gary
Sent: Thursday, November 16, 2017 10:18
To: ADSM-L@VM.MARIST.EDU
Subject: [ADSM-L] counting files in directories for a node

Tsm server 7.1.7.100

I have a request to count the number of files in each directory on the e: drive for a node.
For output, path name, and file count.

Any pointers on where to start?

I can do it given a specific path,

Select count(*) from backups where node_name=bla and hl_name=bla and type='FILE'

How to extend this to all dirs. In a filespace?

Thanks for the help.
The information contained in this transmission contains privileged and confidential information. It is intended only for the use of the person named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

CAUTION: Intended recipients should NOT use email communication for emergent or urgent health care matters.
This message was imported via the External PhorumMail Module
Sorry, only registered users may post in this forum.

Click here to login