HI
I need some help on this below one
Have summuary file coming on daily basis with list of file names and count ,if the summuary file not exist ,pool it for every 5 mins till it arrives .Once arrived remove first and last line from the file and check all the files in respective director all are exist it,If it exists compare count with file against file exist in OS ,if it matches for all the files then move it some other server .Can any help from any one ?
Regards,
MM
---------- Post updated at 01:44 AM ---------- Previous update was at 01:18 AM ----------
Take all the files from this test file and check whether all are exist ,if all are exist then move to some other direcotry
Example
summary.txt
Last edited by rbatte1; 03-14-2017 at 09:27 AM..
Reason: CODE tags again
Hi
want to check ,grep and sed cannot use single like ,i want to find **** lines in file,if exist only remove those lines .When i am doing the below check throwing error
sed: no input files
Last edited by jim mcnamara; 03-11-2017 at 10:38 AM..
This deletes the lines you want deleted. Drop the mv command if you want to keep the file as it was. Your original code does not make sense to me. The CHECK_FILE variable will always be "empty".
Thanks jim,its working perfect.I need one more conditions to check
Let say summary.txt having 3 files but when checking only 2 files are available in that location ,ensure that 3 files should be exist before proceeding to another step .
PLEASE DON'T edit posts after people have replied to it, pulling the rug from under their feet (and here: yours as well) and rendering their efforts useless!
With your modifications of post#1, jim mcnamara's proposal becomes a pointless no-op.
And, BTW, grepping for a pattern like '****' as you do in post#3 won't work as expected because * is a regex multiplier (zero or more times) character. To remove starred and blank lines from your input, try
The error in post#3 is due to you wanting sed to "edit-in-place" stdin from a pipe.
Re your new request: do you just want a file count of three, or should exactly those three listed files exist? If the former: are there always exactly two header lines to be skipped?
Hi ,
Below code is working fine,exit from loop if not matching .I need to be loop forever untill match both files count .Any help would be appereciated
Hi Guys,
we are planning to enable polling target on our SG in reference to this link
MC/ServiceGuard: Subnet Goes Down when one of the Cluster Node is Down - HP Customer Care (United States - English)
since our server is already in production can we apply the changes with ex. "cmapplyconf... (1 Reply)
I am polling a file on remote host. I have this code that works, but can't explain why it works.
while user@remote.no-exist.com 'ls /user/app1/.done'` ]
do
echo Sleeping for 5 secs
sleep 5;
done
This code works in the way that when the .done file exists on the remote host, the script... (1 Reply)
Hi!
Im trying to make a program that polls a mysqlDB every 5 minutes.
the poll checks a scheduletable in the dB and exicutes a function if
there was a "go" in the scheduletable, and if it retrives a "no go" from the table
it should just wait for another 5 minutes before re polling the DB,
... (1 Reply)
I plan to run a script which will run in background and at predefined times send mails to user . I dont have acees to autosys/ Cron / at jobs
My loop works like this
while (true)
do
getx_time=`date +%H%M`
if ; then
script1.sh
mail_sent_flag=1
elif ; then
script2.sh... (1 Reply)
Hi,
My os is sun solaris 5.10 and Korn shell scripting.
I have a file name like CCNA_EARLY_SWP.w062309
where 062309 is date in mmddyy .This is the value date of the file.(will
I need to check continously from 5.00 - 7.00 am daily for this file .
If the file has not come at 5 am or 7am... (4 Replies)
Hi all,
I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory.
We are OK with this polling approach. I just... (3 Replies)
Hi,
I'm after a bit of advice for the best way to collect files from an ftp server via a unix process. The main issue here is the frequency, the job needs to check for files every minute or so between 8am and 8pm and pull them down to the box if there is anything there.
Originally the... (6 Replies)
Hi,
Can you please help me in implementing a timer based polling for function in C? ie. the function should be called in say 30secs(when 30secs has lapsed).
Thanks (7 Replies)