If you only need the file names, with PHP you can use scandir() to scan the entire web directory and put all the file names in array and filter the array based on the extensions. However, if you need more info than just the filename / extension, scandir() will not provide the ownership and permissions, information.
In that case, if I was doing this, I would simply exec() a variation of the ls -lR comand in a PHP script and put each entry (file information) into an array, and then filter the array as needed.
Of course, you don't need PHP to do this, but since your are using a web server which has PHP already, you might enjoy taking the output (your file inventory) and displaying your inventory results on a web page in addition to a CSV file
See also PHP: fputcsv()
Quote:
fputcsv() formats a line (passed as a fields array) as CSV and writes it (terminated by a newline) to the specified file handle.
Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o
I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)
There are these ksh files and config files that are written and updated on a daily basis.
All I want to do is write a script that finds both these types of files and archive them on a daily basis, to help in restoring in times of system outages and so on. Particulary I'm interested in .ksh ,... (9 Replies)
Below is part of a script i have written to loop through part of a port info file. How do i continue the script to get info for OS Device Name, manufacturer and then put information into an array?
HBA Port WWN: 10000000c9420b4b
OS Device Name: /dev/cfg/c10
Manufacturer: Emulex... (5 Replies)
How can I pass $var_find variable as argment to find command?
test.sh
var_find=' \( -name "*.xml" -o -name "*.jsp" \) '
echo "${var_find}"
find . -type f ${var_find} -print
# Below statement works fine.. I want to replace this with the above..
#find . \( -name "*.xml" -o -name... (4 Replies)
How do we find the partition type in Linux? df -T will give me the mounted partition types like ufs, ext3 etc. How do I find out for say a newly added disk to the system? Please advise...
Thanks (2 Replies)
Hi,
I would like to use find to search for multiple types. For example search for symlink and regular file but not directories, sockets etc.... Something like:
find . -type l,f -name "stuff"
But of course it does not work.
Is there any way to avoid an if statement and to do it faster?
... (0 Replies)
I have a record.txt it will update weekly, and it could be 2 lines or more ...
it just echo each line to the script
san jose,23.34%
tampa,2.15%
dallas,30.20%
seattle,44.29%
Unknown,16.72%
How do i write a shell script to give me a test.pl or bash file which contain
#!/home/perl... (8 Replies)
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
i am looking for a backup script to be run in ssh which can move all *.php files only to a archive
Eg. a folder has 5 sub folders with different file types, which can be mix of PDF, jpeg, gif etc etc.
but the archive generated should only include the *.php files without breaking the directory... (3 Replies)
Discussion started by: netatma
3 Replies
LEARN ABOUT OSF1
newinv
newinv(1) General Commands Manual newinv(1)NAME
newinv - Updates distribution kit master inventory
SYNOPSIS
/usr/bin/newinv mi-file input-path...
OPERANDS
The pathname of the master inventory file to be processed. If no master inventory file exists, you must create an empty one before using
the newinv command. The name of the product hierarchy to be scanned for files belonging in the inventory. All files and directories found
below the input-path are processed as belonging in the inventory.
DESCRIPTION
The newinv command interactively maintains the master inventory files used for producing distribution kits in setld format. The program
updates the master inventory for a product when changes are made to the hierarchy of files that are to be packaged in the subsets which
constitute the product.
The product hierarchy is scanned to produce a list of component path names relative to input-path. The list of pathnames is processed
against the mi-file to produce a list of files that have been removed from the product hierarchy and a list of files that have been added.
The user is then given an opportunity to intervene and direct the inventory maintenance by editing these lists. The user is placed in the
editor with each list available for editing. The editor used is the one specified by the EDITOR environment variable. If EDITOR is not
set, vi is used. When editing the list of files that have been removed from the product, the user is expected to verify that the removals
were intentional and confirm the intent by removing the associated records from the file. When editing the list of added files, the user
is expected to provide options and subset information for each new file, transforming the elements of the list into master inventory
records.
To produce a new copy of the master inventory file, both of these lists are merged with the records for the files which existed in the pre-
vious version and are still included.
RESTRICTIONS
The default text editor, if not specified in $EDITOR, is /usr/ucb/vi.
Files in the product hierarchy cannot be excluded from the master inventory. Files can be blocked from being kitted in the final distribu-
tion kit by setting the subset field of the master inventory record to a minus sign (-).
ERRORS
The mi-file specified on the command line cannot be found. The input-path directory specified on the command line does not exist.
EXAMPLES
To update the hypothetical master inventory file OAT100.mi from the hierarchy beginning at /var/kits/input, type:
newinv OAT100.mi /var/kits/input
FILES
Backup copy of master inventory The list of files missing from the product The list of files new to the product Intermediate join file List
of all files in the product
SEE ALSO invcutter(1), kits(1), vi(1), setld(8)stl_mi(4)environ(5) Guide to Preparing Product Kits
newinv(1)