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 DEBIAN
ocsinventory::agent::common
Ocsinventory::Agent::Common(3pm) User Contributed Perl Documentation Ocsinventory::Agent::Common(3pm)
addController()
Add a controller in the inventory.
addModem()
Add a modem in the inventory.
addDrive()
Add a partition in the inventory.
addStorages()
Add a storage system (hard drive, USB key, SAN volume, etc) in the inventory.
addMemory()
Add a memory module in the inventory.
addPort()
Add a port module in the inventory.
addSlot()
Add a slot in the inventory.
addSoftware()
Register a software in the inventory.
addMonitor()
Add a monitor (screen) in the inventory.
addVideo()
Add a video card in the inventory.
addSound()
Add a sound card in the inventory.
addNetwork()
Register a network in the inventory.
setHardware()
Save global information regarding the machine.
The use of setHardware() to update USERID and PROCESSOR* informations is deprecated, please, use addUser() and addCPU() instead.
setBios()
Set BIOS informations.
addCPU()
Add a CPU in the inventory.
addUser()
Add an user in the list of logged user.
addPrinter()
Add a printer in the inventory.
addVirtualMachine()
Add a Virtual Machine in the inventory.
addProcess()
Record a running process in the inventory.
addIpDiscoverEntry()
IpDiscover is used to identify network interface on the local network. This is done on the ARP level.
This function adds a network interface in the inventory.
setAccessLog()
What is that for? :)
flushXMlTags()
Clear the content of $common->{xmltags} (to use after adding it in XML)
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
Around line 34:
'=item' outside of any '=over'
perl v5.14.2 2012-04-12 Ocsinventory::Agent::Common(3pm)