I have the following code which gives me kind of what I need:
And this is how it works:
But what I really need is to:
1. find only directories and files with 777 permission on HP and Linux servers; so I want one script where I can ssh to each server and grab a listing of all 777 dir\files and put them in a comma delimited file
2.After getting the data into the file I need to then write it to a MySQL DB called audit into a table called myperms; I need to do this for about 25 servers
3. In Type; if it's a dir the script does put a "d" and that's what I want written to the table but I want "f" if it's a file not an "-".
I am failry new to perl; however I know how to connect to my MySQL and open a file to get data. My shorcomings in Perl though is that I do not know how to write data into a table. Also I do not know how I can modify the abaove script to start checking from the root "/" and go through the entitre server...how to get all server (a loop maybe?)
Here's a sample of some server names that you can use.
Hope someone can help me out.
Thanks all in advance
Regards
Giuliano
Last edited by Franklin52; 02-27-2012 at 03:27 AM..
Reason: Please use code tags for code and indent your code, thank you
If you want to search the entire file system on each of a set of hosts, then this small bit of a script will generate a (potentially long) comma separated list of files/directories which have a permission setting of 777. The first field of the list is the hostname.
I don't do SQL, so I cannot help with getting this loaded into any kind of DB, but this might get you started.
Hello,
I am running ubuntu 16.04 and I have rented a server three days ago.
I am with OVH and during image installation I did not merge hdd partitions, just proceed with custom installation configuration.
Today I rebooted and server went offline.
Company says: "Connect in rescue mode and check... (4 Replies)
If I have a A.log
1 Air Flow Monitor : 34.070 Degrees C
2 Air Flow Monitor : 41.730 Degrees C
3 Air Flow Monitor : 35.340 Degrees C
4 Air Flow Monitor : 33.370 Degrees C
5 Air Flow Monitor : 36.770 Degrees C
6 Air Flow Monitor : 45.910 Degrees C
7 Air Flow Monitor ... (1 Reply)
Hi All
I would like to get cars DB from this web site link removed , and I am trying to right script to go and parse the web page and save the data for each cars into a file, type of cars, mark, model, but when I look to the source page I found out that the first car type is preselected and the... (3 Replies)
My requirement is to read a column data from a file & save it in a variable for each row & process it. I am using the below code-
Leadlines="$TGTFILE/Error.txt">>$log_file
while read line
do
id = ` echo $line | cut -d "," -f1 `
email = ` echo $line | cut -d "," -f2 `
-----------
done
My... (2 Replies)
Hello,
I have the following data format in a log file :
a : x1
b : x2
c : x3
d : x4
--------
a : x5
b : x6
c : x7
d : x8
so the same fields ( a ,b ,c,d) repeated many times in the same log file but with different "x" values (x5,x6,x7,x8).
I need a script to save this data in an... (6 Replies)
Hi
I am new to linux, when I typed "vi FILE1" I was able to open VI editor. I added some data and I want to save the file and I tried :w but it threw me an error.
"file1" E212: Can't open file for writing
Press ENTER or type command to continue
why I am not able to save it?
I read it... (16 Replies)
Im trying to come up with a simple shell script to display info about the current user.`pwd`; `date` ; `who am i`
I want to give the option to save all the data thats display by the commands to a log file. With a timestamp as the name of the file
This is where im stuck
echo "Would you like to... (3 Replies)
Hello all:
I need found script to save and restore file permissions and owner:group... this is for backup my server...
I have one problem in my server and file permissions and owner:group, mess up..
For this reason i need found one way to secure this aspect of the server...
Thanks! (1 Reply)
Hello,
Our RAID and server recently crashed and we are trying to recover our data. The problem appears to be that the Veritas File System/Logical Volume Manger became corrupt on our RAID. We are down to our last option, which is to run some Veritas commands that "may" result in data loss.
... (1 Reply)