- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Check consistency
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2009 07:03 PM
07-12-2009 07:03 PM
Check consistency
In this two files ( file 1 and file 2 ) , the file named with .txt should be the same , ( in file 2 , all file name begins with /tmp/file2 ) , the .txt file name is separated by the date string ( eg. 20090709-1930 ) , the .txt file name and date string is append to file 1 and file 2 from time to time ,
To make sure the .txt file name in both file ( file 1 and file 2 ) is consistency , I would like to regularly check the files , when found the files is not consistency ( eg. in file 1 have ???.txt while file B do have have corresponding file name in it ) , then send me a notification , can advise if I would like to check the file consistency of the same day , how can I write the script ? thx much in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2009 07:11 PM
07-12-2009 07:11 PM
Re: Check consistency
======
"
"
20090709-1930
20090709-2000
20090709-2030
20090709-2100
20090709-2130
aaa.txt
20090709-2200
20090709-2230
20090709-2300
20090709-2330
20090709-0000
20090710-0030
20090710-0100
20090710-0130
bbb.txt
20090710-0200
20090710-0230
20090710-0300
20090710-0330
20090710-0400
20090710-0430
20090710-0500
20090710-0530
20090710-0600
ccc.txt
20090710-0630
20090710-0700
20090710-0730
20090710-0800
20090710-0830
ddd.txt
eee.txt
fff.txt
ggg.txt
hhh.txt
20090710-0900
20090710-0930
20090710-1000
20090710-1030
20090710-1100
20090710-1130
20090710-1200
20090710-1230
20090710-1300
20090710-1330
"
"
"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2009 07:12 PM
07-12-2009 07:12 PM
Re: Check consistency
======
"
"
20090709-1930
20090709-2000
20090709-2030
20090709-2100
20090709-2130
20090709-2200
/tmp/file2aaa.txt
20090709-2230
20090709-2300
20090709-2330
20090709-0000
20090710-0030
20090710-0100
20090710-0130
20090710-0200
/tmp/file2bbb.txt
20090710-0230
20090710-0300
20090710-0330
20090710-0400
20090710-0430
20090710-0500
20090710-0530
20090710-0600
20090710-0630
/tmp/file2ccc.txt
20090710-0700
20090710-0730
20090710-0800
20090710-0830
20090710-0900
20090710-0930
/tmp/file2/ddd.txt
/tmp/file2/eee.txt
/tmp/file2/fff.txt
/tmp/file2/ggg.txt
/tmp/file2/hhh.txt
20090710-1000
20090710-1030
20090710-1100
20090710-1130
20090710-1200
20090710-1230
20090710-1300
20090710-1330
"
"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2009 09:41 PM
07-12-2009 09:41 PM
Re: Check consistency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 01:13 AM
07-13-2009 01:13 AM
Re: Check consistency
sed 's:/tmp/file2::' file2 > file2.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 06:15 PM
07-13-2009 06:15 PM
Re: Check consistency
I tried the way :
sed 's:/tmp/file2::' file2 > file2.new
it seems works for a part of requirement , this is really not easy for me to complete it , I am not familiar with script writing , can anyone provide more guidance ? thx much .
I am not familiar with script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 10:48 PM
07-13-2009 10:48 PM
Re: Check consistency
What is the requirement? That the two files compare after removing all of the date strings?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 12:57 AM
07-14-2009 12:57 AM
Re: Check consistency
no need to remove anything , what I would like is to find out any file ( in file 1 and file 2 )is missing only .
thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 01:37 AM
07-14-2009 01:37 AM
Re: Check consistency
Something like this:
fgrep ".txt" file1 > file1.new
sed -e 's:/tmp/file2/::' -e 's:/tmp/file2::' file2 | fgrep ".txt" > file2.new
diff file1.new file2.new
rm -f file1.new file2.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 03:07 AM
07-14-2009 03:07 AM
Re: Check consistency
the files are in different servers , can advise how can I use your script to compre it ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 07:46 AM
07-14-2009 07:46 AM
Re: Check consistency
You will have to move the files to a common system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 12:12 AM
07-15-2009 12:12 AM
Re: Check consistency
Do you hv idea to do it ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 01:33 AM
07-15-2009 01:33 AM
Re: Check consistency
You can use NFS to share files. You can use ftp, rcp, sftp, scp to copy the files.
Or you could compute a checksum, then take that ascii string and compare with the other checksum.