[CentOS] - automation script

Lists lists at benjamindsmith.com
Sat Mar 1 19:14:14 UTC 2014


On 03/01/2014 08:01 AM, Les Mikesell wrote:
> On Sat, Mar 1, 2014 at 3:23 AM, Paolo De Michele
> <paolo at paolodemichele.it> wrote:
>> Hi everybody,
>>
>> I have many server in production but I would verify this:
>>
>> ex.: I have many domain in /var/www/html/ (domain1 / domain2 / domain3)
>>
>> now,
>>
>> How I do check if the files are added or changed?
>> I should apply this "politic" for all domains but I don't know how
>>
>> It is possible send me an email with the modification?
>> so, exist diff command with some option but I don't understand how to apply it
>
> If you installed with an rpm you can use 'rpm -q -V packagename' to
> check that files haven't changed since the install.
>
> If you have a master copy on some other server, you can  use 'rsync
> -avn  --delete dir  user at production_host:/path/above/dir' to see a
> list of files with differences.  And if you remove the n from the
> arguement list it will fix any differences (but be very sure you are
> in the right place if you use --delete without -n).
>
> Ultimately, you should probably be using subversion or git to maintain
> this master copy. If you only have one or a few production servers you
> can just use the version control tools to update them directly, but I
> prefer a staging copy where you can test the changes before rsyncing
> to production.
>

All good suggestions. I'd prefer mercurial to either of Subversion 
(central repo? Blagh!) or git (mercurial
has easier syntax) but that's minor.

One more (super simple) thing to try:

$ touch releasetime.txt;
// do something else for a day or three
$ find /var/www -newer releasetime.txt;





More information about the CentOS mailing list