Sponsored Content
Full Discussion: compare realtime
Top Forums Shell Programming and Scripting compare realtime Post 302108537 by matrixmadhan on Tuesday 27th of February 2007 06:04:08 AM
Old 02-27-2007
Code:
#! /opt/third-party/bin/perl

my($i, %fileHash_a, %fileHash_b);

for( ;1; sleep 5 ) {

%fileHash_a = ();
%fileHash_b = ();

open(FILE, "< a") || die "file a <$!>\n";

while( <FILE> ) {
  chomp;
  $fileHash_a{$_} = $i++;
}

close(FILE);

$i=0;
open(FILE, "< b") || die "file b <$!>\n";
while( <FILE> ) {
  chomp;
  $fileHash_b{$_} = $i++;
}

close(FILE);

  open(FILE, "> update") || die "update <$!>\n";

  foreach my $k ( keys %fileHash_a ) {
    if ( exists $fileHash_b{$k} ) {
    }
    else {
      print FILE $k . "\n";
    }
  }
  close(FILE);
}


exit 0

All the differences would be captured in the file 'update'
This is a continuously running script, run it as a background process
Refresh rate can be altered through the sleep value given in for loop
Minimal time taken in comparison and generating what is not available in first file with respect to the second file
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Copying files realtime

I have a primary server where certain files are created real time. These files have varying file sizes. I want to FTP or copy them over to a different server server as soon a file gets created. I have to ensure that only full file is copied. The receiving end process expects a FULL file. I am ok... (3 Replies)
Discussion started by: vskr72
3 Replies
innoextract(1)						      General Commands Manual						    innoextract(1)

NAME
innoextract - tool to extract installers created by Inno Setup SYNOPSIS
innoextract [-behlLqstv] [-ccolor] [-pprogress] installers ... DESCRIPTION
innoextract is a tool that can extract installer executables created by Inno Setup. innoextract will extract files from a installers specified on the command line. To extract a multi-part installer with external data files, only the executable (.exe) file needs to be given as an argument to innoex- tract. OPTIONS
-c --color [enable] By default innoextract will try to detect if the terminal supports shell escape codes and enable or disable color output accord- ingly. Pass 1 or true to --color to force color output. Pass 0 or false to never output color codes. --dump Don't convert Windows paths to UNIX paths and don't substitute variables in paths. -e --extract Extract all files to the current directory. This is the default action. You may only specify one of --extract , --list and --test -h --help Show a list of the supported options. --language [lang] Extract only language-independent files and files for the given language. By default all files are extracted. --license Show license information. -l --list List files contained in the installer but don't extract anything. You may only specify one of --extract , --list and --test -L --lowercase Convert filenames stored in the installer to lower-case before extracting. -p --progress [enable] By default innoextract will try to detect if the terminal supports shell escape codes and enable or disable progress bar output accordingly. Pass 1 or true to --progress to force progress bar output. Pass 0 or false to never show a progress bar. -q --quiet Less verbose output. -s --silent Don't output anything except errors and warnings. -t --test Test archive integrity but don't write any output files. You may only specify one of --extract , --list and --test -v --version Show the innoextract version number and supported Inno Setup versions. LIMITATIONS
innoextract currently only supports extracting all the data. There is no support for extracting individual files, components or languages. Included scripts and checks are not executed. Data is always extracted to the current directory and the mapping from Inno Setup variables like the application directory to subdirecto- ries is hard-coded. innoextract does not check if an installer includes multiple files with the same name and will continually overwrite the destination file when extracting. Names for data files in multi-file installers must follow the standard naming scheme. Encrypted installers are not supported. SEE ALSO
cabextract(1), unshield(1) BUGS
No known bugs. AUTHOR
Daniel Scharrer (daniel@constexpr.org) 1.2 2012-04-01 innoextract(1)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy