Sponsored Content
Top Forums Shell Programming and Scripting Script to compare all the config files in a cluster of servers. Post 302288193 by cfajohnson on Monday 16th of February 2009 04:56:13 PM
Old 02-16-2009
Quote:
Originally Posted by rdlover
Thank you. I think thats a good idea,although it'll end up creating 15 logs on the server each time i run the script, but i should be able to live with that.

If you don't want 15 log files, redirect them all to one file, e.g.:

Code:
for host in $hostlist
do
   ssh "$host" "diff App_B.cfg App_B.cfg.021509"
done > logfile-$(date +%Y-%m-%d)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a sheel script to compare no of file on diffrent servers

i have serverA and serverB and i have a folder with same name an location in both servers.... Now i want to compare files in folder(serverA) with folder (serverB) if there are files missing in folderB then copy those files from folder(serverA) to folder(serverB) (1 Reply)
Discussion started by: ashahzad
1 Replies

2. Web Development

bash script editing my apache config files

okay i'm going to try to say this uber-simple: I use dropbox (file-sync service). in order for dropbox sync files, they must be its children eg. somewhere under /home/jzacsh/Dropbox]. I want to now use it to keep my development files in sync across my machines: easy: just move my dev. files... (2 Replies)
Discussion started by: jzacsh
2 Replies

3. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

4. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

5. Shell Programming and Scripting

Script to login to several servers and get files

Hi ppl, I am looking out for a shell script a. That would have to login(from a main server) to say 16 servers individually. b.On each server go to a particular location, check if a particular file is generated on a date(say every sunday it gets generated and i would be interested in the latest... (8 Replies)
Discussion started by: yohasini
8 Replies

6. Shell Programming and Scripting

Help related to Script to move files depending on config values

Hi All, I am new to Unix scripting, I have requirement where I need to read the key value pair from config file. Sample Config file: Key(File Pattern) Value(File Directory location) test /Users/Bkumar/Downloads/testdir prod ... (1 Reply)
Discussion started by: sbpkumar7
1 Replies

7. Shell Programming and Scripting

List and Compare Files accross different servers.

Hi all, This is my situation. First thing is I cannot use rsync to accomplish this. I don't have on my systems and we can't put it on. I run HP-UX 11v3. I have a list of files generated every day which tells me which files are not in sync with the rest of the servers.I want to ls -l the... (1 Reply)
Discussion started by: zixzix01
1 Replies

8. Shell Programming and Scripting

Compare the files in 2 different servers for change or modification

I have the following requirement; I need to compare set of files in 2 different servers A and B. Both have same sets of files and directory structure First I need to move the files from Server A to server B Compare the corresponding file in B server and see if it has modified (not... (1 Reply)
Discussion started by: vskr72
1 Replies

9. Shell Programming and Scripting

Compare files in 2 servers

I need to compare same set of files in 2 different servers and generate a list (in STDOUT) which contain all the files that have changed. I don't have permission to create any temp files or folders in either servers. - One option is to use ' if '. But for this I need to move file1 to one server... (1 Reply)
Discussion started by: vskr72
1 Replies

10. Shell Programming and Scripting

Help with shell script to compare values between servers

Hi I am a beginner in UNIX and shell scripting and i have a requirement as stated below, requirement Login to a unix server 1 1. connect to a database mysql -uUsername -pPassword 2. Select a Schema : "Use Schemaname1" 3. query for a particular record ... (2 Replies)
Discussion started by: Hamdul
2 Replies
Apache::TestConfig(3pm) 				User Contributed Perl Documentation				   Apache::TestConfig(3pm)

NAME
Apache::TestConfig -- Test Configuration setup module SYNOPSIS
use Apache::TestConfig; my $cfg = Apache::TestConfig->new(%args) my $fh = $cfg->genfile($file); $cfg->writefile($file, $content); $cfg->gendir($dir); ... DESCRIPTION
"Apache::TestConfig" is used in creating the "Apache::Test" configuration files. FUNCTIONS
genwarning() my $warn = $cfg->genwarning($filename) genwarning() returns a warning string as a comment, saying that the file was autogenerated and that it's not a good idea to modify this file. After the warning a perl trace of calls to this this function is appended. This trace is useful for finding what code has created the file. my $warn = $cfg->genwarning($filename, $from_filename) If $from_filename is specified it'll be used in the warning to tell which file it was generated from. genwarning() automatically recognizes the comment type based on the file extension. If the extension is not recognized, the default "#" style is used. Currently it support "<!-- -->", "/* ... */" and "#" styles. genfile() my $fh = $cfg->genfile($file); genfile() creates a new file $file for writing and returns a file handle. If parent directories of $file don't exist they will be automagically created. The file $file and any created parent directories (if found empty) will be automatically removed on cleanup. A comment with a warning and calls trace is added to the top of this file. See genwarning() for more info about this comment. my $fh = $cfg->genfile($file, $from_file); If $from_filename is specified it'll be used in the warning to tell which file it was generated from. my $fh = $cfg->genfile($file, $from_file, $nowarning); If $nowarning is true, the warning won't be added. If using this optional argument and there is no $from_file you must pass undef as in: my $fh = $cfg->genfile($file, undef, $nowarning); writefile() $cfg->writefile($file, $content, [$nowarning]); writefile() creates a new file $file with the content of $content. A comment with a warning and calls trace is added to the top of this file unless $nowarnings is passed and set to a true value. See genwarning() for more info about this comment. If parent directories of $file don't exist they will be automagically created. The file $file and any created parent directories (if found empty) will be automatically removed on cleanup. write_perlscript() $cfg->write_perlscript($filename, @lines); Similar to writefile() but creates an executable Perl script with correctly set shebang line. gendir() $cfg->gendir($dir); gendir() creates a new directory $dir. If parent directories of $dir don't exist they will be automagically created. The directory $dir and any created parent directories will be automatically removed on cleanup if found empty. Environment Variables The following environment variables affect the configuration and the run-time of the "Apache::Test" framework: APACHE_TEST_COLOR To aid visual control over the configuration process and the run-time phase, "Apache::Test" uses coloured fonts when the environment variable "APACHE_TEST_COLOR" is set to a true value. APACHE_TEST_LIVE_DEV When using "Apache::Test" during the project development phase, it's often convenient to have the project/lib (live) directory appearing first in @INC so any changes to the Perl modules, residing in it, immediately affect the server, without a need to rerun "make" to update blib/lib. When the environment variable "APACHE_TEST_LIVE_DEV" is set to a true value during the configuration phase ("t/TEST -config", "Apache::Test" will automatically unshift the project/lib directory into @INC, via the autogenerated t/conf/modperl_inc.pl file. Special Placeholders When generating configuration files from the *.in templates, special placeholder variables get substituted. To embed a placeholder use the "@foo@" syntax. For example in extra.conf.in you can write: Include @ServerRoot@/conf/myconfig.conf When extra.conf is generated, "@ServerRoot@" will get replaced with the location of the server root. Placeholders are case-insensitive. Available placeholders: Configuration Options All configuration variables that can be passed to "t/TEST", such as "MaxClients", "DocumentRoot", "ServerRoot", etc. To see the complete list run: % t/TEST --help and you will find them in the "configuration options" sections. NextAvailablePort Every time this placeholder is encountered it'll be replaced with the next available port. This is very useful if you need to allocate a special port, but not hardcode it. Later when running: % t/TEST -port=select it's possible to run several concurrent test suites on the same machine, w/o having port collisions. AUTHOR
SEE ALSO
perl(1), Apache::Test(3) perl v5.14.2 2011-12-26 Apache::TestConfig(3pm)
All times are GMT -4. The time now is 01:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy