Sponsored Content
Top Forums Shell Programming and Scripting Sendig a file and a confirm file Post 302800681 by mjf on Tuesday 30th of April 2013 08:46:59 AM
Old 04-30-2013
Below is just one example of how you can define a trailer record at the end of the file. The trailer record has a record type (1st char of rec) of '3' and is followed by the total count (000004) of detail records (those with a record type of '2' in this example). The process that reads this file after it's transferred should count the number of actual detail records on the file and compare that number to the total count on the trailer record. If the count is different or if no trailer record is found, then that means that the transfer or file is incomplete. This file also contains a header record with a date which the process can also validate so an older or unexpected file is not processed. Surely there can be many variations to this.
Code:
 
cat file.txt
1 20130430
2 Detail Rec 1
2 Detail Rec 2
2 Detail Rec 3
2 Detail Rec etc
3 000004

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Confirm before delete.

I have a script that archive files then delete.How do Its working fine,however,before I perform the delete operation,I want to verify that indeed the FILE is in the path of folder I want to archive. For example,I have a path /A/B I want all files in B to be archived,the scripts lists all the... (5 Replies)
Discussion started by: kayarsenal
5 Replies

2. UNIX for Dummies Questions & Answers

Confirm job execution

Hello everybody, Can anybody tell me how do we comfirm the execution of a scheduled job ? In other words, how do I know whether my scheduled script is being executed or not ? Thanks Jitu JK (2 Replies)
Discussion started by: jitu.jk
2 Replies

3. Solaris

How can we confirm that, the disk has failed in Solaris?

Hi All, Seems to be one of the disk has failed on my Solaris server. How do i confirm that disk has really failed or not? Here are alert details. ------- iostat -En out/put c1t3d0 Soft Errors: 1884 Hard Errors: 153 Transport Errors: 54 Vendor: FUJITSU Product:... (3 Replies)
Discussion started by: Naresh Kommina
3 Replies

4. Solaris

Confirm the location of the bootblk kernel

Dear All i am new to solaris. I am using solaris 5.10 running on my sun blade 150 (sparc). Nowadays i studying about boot process and i am bit confused with the location of the kernel,bootblk. As i found through the internet, The location of the kernel is ... (0 Replies)
Discussion started by: kingston
0 Replies

5. Shell Programming and Scripting

Script to Reboot and Confirm

On my Solaris box I have to reboot some devices like below. However I think this can be done through a script. I've create a list that contains the devices IP addresses. Here's the logic: Reboot 4 devices and sleep for 5mins(300s.) While the devices are rebooting, I would like to confirm... (9 Replies)
Discussion started by: ravzter
9 Replies

6. Shell Programming and Scripting

sed - How to confirm substitution

How to confirm whether a particular substitution taken place or not ? Find the code below :- #!/bin/ksh COUNT=0 ####### Create backup of the original file ###### cp passwd passwd_old ####### Read the csv file for unixid and project ###### while IFS=, read unix_id project_id do ... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

7. Shell Programming and Scripting

Confirm file copy

Need to check whether the source file(FTP'ed file) is completly copied or not such that I can further action on the same. I have created the below script to achieve this by checking for every 10secs to whether file size is same or not but it may create a problem if the file transfer is slow and if... (4 Replies)
Discussion started by: palanisvr
4 Replies

8. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

9. AIX

Need to confirm something regarding TL upgrades

Hi everyone, My current AIX OS level is "7100-01-06-1241" and I am planning to upgrade it to " 7100-02-03 ". Can i directly upgrade it to "7100-02-03" from 7100-01-06" ? or first i need to upgrade the "7100-01-06" LPAR to TL 02 and then reboot and then upgrade it to TL 02 SP03 ? ... (4 Replies)
Discussion started by: System Admin 77
4 Replies

10. UNIX for Dummies Questions & Answers

How to confirm that I've reached the nproc limit?

Hi, I am getting the error su: cannot set user id: Resource temporarily unavailable. In limits.conf, it shows soft nproc 2047 for this user. ps H -u | wc -l shows 508 processes only. Linux flavour is Red Hat Enterprise Linux Server release 5.10 (Tikanga) Any advice will be much... (1 Reply)
Discussion started by: newbie_01
1 Replies
LTDBTOOL(1)						   CTDB - clustered TDB database					       LTDBTOOL(1)

NAME
ltdbtool - manipulate CTDB's local TDB files SYNOPSIS
ltdbtool [OPTION...] {COMMAND} [COMMAND-ARGS] DESCRIPTION
ltdbtool is a utility to manipulate CTDB's local TDB databases (LTDBs) without connecting to a CTDB daemon. It can be used to: o dump the contents of a LTDB, optionally printing the CTDB record header information, o convert between an LTDB and a non-clustered tdb by adding or removing CTDB headers and o convert between 64 and 32 bit LTDBs where the CTDB record headers differ by 4 bytes of padding. OPTIONS
-e Dump empty records. These are normally excluded. -p Dump with header information, similar to "ctdb catdb". -s {0 | 32 | 64} Specify how to determine the CTDB record header size for the input database: 0 no CTDB header 32 CTDB header size of a 32 bit system (20 bytes) 64 CTDB header size of a 64 bit system (24 bytes) The default is 32 or 64 depending on the system architecture. -o {0 | 32 | 64} Specify how to determine the CTDB record header size for the output database, see -s. -S SIZE Explicitly specify the CTDB record header SIZE of the input database in bytes. -O SIZE Explicitly specify the CTDB record header SIZE for the output database in bytes. -h Print help text. COMMANDS
help Print help text. dump IDB Dump the contents of an LTDB input file IDB to standard output in a human-readable format. convert IDB ODB Copy an LTDB input file IDB to output file ODB, optionally adding or removing CTDB headers. EXAMPLES
Print a local tdb in "tdbdump" style: ltdbtool dump idmap2.tdb.0 Print a local tdb with header information similar to "ctdb catdb": ltdbtool dump -p idmap2.tdb.0 Strip the CTDB headers from records: ltdbtool convert -o0 idmap2.tdb.0 idmap.tdb Strip 64 bit CTDB headers from records, running on i386: ltdbtool convert -s64 -o0 idmap2.tdb.0 idmap.tdb Strip the CTDB headers from records by piping through tdbrestore: ltdbtool dump idmap2.tdb.0 | tdbrestore idmap.tdb Convert a local tdb from a 64 bit system for usage on a 32 bit system: ltdbtool convert -s64 -o32 idmap2.tdb.0 idmap2.tdb.1 Add a default header: ltdbtool convert -s0 idmap.tdb idmap2.tdb.0 SEE ALSO
ctdb(1), tdbdump(1), tdbrestore(1), ctdb(7), http://ctdb.samba.org/ AUTHOR
This documentation was written by Gregor Beck COPYRIGHT
Copyright (C) 2011 Gregor Beck, Michael Adam This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses. ctdb 11/27/2013 LTDBTOOL(1)
All times are GMT -4. The time now is 03:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy