Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Updating a field in a File without creating temp file's Post 302320623 by prabhutkl on Thursday 28th of May 2009 12:27:18 PM
Old 05-28-2009
Updating a field in a File without creating temp file's

Hi Experts,

I have a requirement where i need to update the below items in file,

1. END TIME
2. PREV_STATUS

For the first time the PREV_status and end time of all job the job will be sysdate & NULL reply as below,

Session_name,Load Type,Frequency,Seesion End time,Prev_Status
s_d_m_crm_srr_team_sales,Full,Daily,28-MAY-2009 19:30:00,
s_d_m_crm_srr_team_mbrs_sales,Full,Daily,28-MAY-2009 18:30:00,
s_d_m_crm_srr_team_history_sales,Full,Daily,28-MAY-2009 17:30:00,
s_d_m_crm_srr_employees_sales,Full,Daily,28-MAY-2009 19:50:00,
s_d_m_crm_srr_jobs_sales,Full,Daily,28-MAY-2009 11:30:00,
s_d_m_crm_srr_employee_job_hist_sales,Full,Daily,28-MAY-2009 12:30:00,
s_d_m_crm_srr_x_tmbr_cust_sales,Full,Daily,28-MAY-2009 10:30:00,
s_d_m_crm_srr_x_team_tmbr_sales,Full,Daily,28-MAY-2009 11:30:00,
s_d_m_crm_srr_employees_specifics,Full,Daily,28-MAY-2009 09:30:00,
s_d_m_crm_srr_team_hierarchy_sales,Full,Daily,28-MAY-2009 01:30:00,

On successful completion of each job has to update the record's as below reply,

Session_name,Load Type,Frequency,Seesion End time,Prev_Status
s_d_m_crm_srr_team_sales,Full,Daily,29-MAY-2009 19:30:00,SUCCEEDED
s_d_m_crm_srr_team_mbrs_sales,Full,Daily,29-MAY-2009 18:30:00,FAILED
s_d_m_crm_srr_team_history_sales,Full,Daily,28-MAY-2009 17:30:00,
s_d_m_crm_srr_employees_sales,Full,Daily,29-MAY-2009 19:50:00,SUCCEEDED
s_d_m_crm_srr_jobs_sales,Full,Daily,29-MAY-2009 11:30:00,SUCCEEDED
s_d_m_crm_srr_employee_job_hist_sales,Full,Daily,29-MAY-2009 12:30:00,SUCCEEDED
s_d_m_crm_srr_x_tmbr_cust_sales,Full,Daily,29-MAY-2009 10:30:00,SUCCEEDED
s_d_m_crm_srr_x_team_tmbr_sales,Full,Daily,29-MAY-2009 11:30:00,SUCCEEDED
s_d_m_crm_srr_employees_specifics,Full,Daily,29-MAY-2009 09:30:00,SUCCEEDED
s_d_m_crm_srr_team_hierarchy_sales,Full,Daily,29-MAY-2009 01:30:00,SUCCEEDED

Since I am going to run the all the jobs parallely and there is high possiblity of updating the status and END TIME parallely in a file.

It has to update only one record in file without any temporary file to miss the latest updation.

It will be grateful if you could help me out to get sort out my requirement?

Thanks,
Prabhu
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append to end of each line of file without a temp file.

Hello I am trying to append an incrimenting number to the end of each line I have it working with a temp file. But I want to do this without a temp file. a=1 cat "file" | while read LINE do echo "$LINE, $a" >> filewithnumbers a=`expr $a + 1` ... (4 Replies)
Discussion started by: rorey_breaker
4 Replies

2. Shell Programming and Scripting

awk updating one file with another, comparing, updating

Hello, I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^ Here is what I'm trying to achieve : file1: test filea 3495; test fileb 4578; test filec 7689; test filey 9978; test filez 12300; file2: test filea... (11 Replies)
Discussion started by: mecano
11 Replies

3. Shell Programming and Scripting

find and replace a string in a file without the use of temp file

Hi - I am looking for a replacing a string in a in multiple *.sql files in directory with a new string without using a temporary file Normally I can use sed command as below for W in ls `FILE*.sql` do sed 's/OLD/NEW/g' $W > TEMPFILE.dat mv TEMPFILE.dat $W done But Here in my... (9 Replies)
Discussion started by: raghutapal
9 Replies

4. Shell Programming and Scripting

Lookup on large file based on a temp file

hello guys Please help me with the below issue I have two files one base file another lookupfile base file abc-001 bcd-001 cde-001 Lookupfile abc-001|11|12 abc-001|11|12 abc-001|11|12 (6 Replies)
Discussion started by: Pratik4891
6 Replies

5. Shell Programming and Scripting

Store the name of an extracted file to a temp file

What would be the best way to store the name of an extracted file from a tar to a text file? I want to extract one file from a tar and store the name of the extracted file to a temp file. tar -xvf tar_file.tar file_to_be_extracted (1 Reply)
Discussion started by: erin00
1 Replies

6. UNIX for Advanced & Expert Users

Creating the script for updating or replacing the existing http.conf file

Hi I need some help with a task, i am an absolute newbie to any form of shell scripting and request guidance. I have been building a proxy server using the apache mod proxy currently my solution is working , but i need to automate the process , suppose if any changes need to be made on... (0 Replies)
Discussion started by: satej
0 Replies
rlm_counter(5)							 FreeRADIUS Module						    rlm_counter(5)

NAME
rlm_counter - FreeRADIUS Module DESCRIPTION
The rlm_counter module provides a general framework to allow access based on accumulated usage of a resource, such as total time online in a given period, total data transferred in a given period, etc. This is very useful in a 'Prepaid Service' situation, where a user has paid for a finite amount of usage and should not be allowed to use more than that service. Collection, monitoring, and replenishment of prepaid services are beyond the scope of this module. The main configuration items to be aware of are: filename The filename where the usage data is stored. key An attribute which will be present in the Access-Request to be used as the 'index' value for the counter. A counter entry is tracked for each unique key. The most likely key you will want to use is User-Name. count_attribute An attribute which will be used to increment the counter value. If this attribute is Acct-Session-Time or an integer value the counter data is incremented by the Attribute value. For all other attribute types the counter is incremented by one. reset How frequently the counter data should be set back to 0. Valid values for this variable are: hourly, daily, weekly, monthly, orn- ever Alternatively, it can be user defined, in the form: num[hdwm]. num is a numeric value, followed by one or none of the follow- ing letters. h: hours, d: days, w: weeks, m: months. check_name This defines an attribute name which will be registered by the counter module and can be used to set the maximum allowed value for the counter after which the user is rejected. If Daily-Session-Time is set, you can use the following syntax in the Users file to set a cap of 3600 seconds ( 8 hours ): DEFAULT Max-Daily-Session := 3600 reply_name This is the name of the attribute which will contain the remaining value for the counter in the reply packet when the user is suc- cessfully authorized. The default attribute name is "Session-Timeout". allowed_service_type This can be used to only apply the limitations to specific service types of sessions. For example, setting this to Framed-User will only apply the counter module to Framed sessions, excluding other types such as Telnet or Rlogin. cache_size The maximum size of the cache to be used by the module. The default is 1000. NOTES
This module registers an attribute, so it should be added to the instantiate section, to be called on server startup. When used in the authorize section, it must come after any modules which set the 'check_name' attribute. SECTIONS
instantiate, authorize, accounting FILES
/etc/raddb/radiusd.conf SEE ALSO
radiusd(8), radiusd.conf(5) rlm_sqlcounter(5) AUTHOR
Chris Parker, cparker@segv.org 13 March 2004 rlm_counter(5)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy