- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- scp2 not completely overwriting a file?
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
Discussions
Discussions
Forums
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
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
тАО10-09-2007 06:58 AM
тАО10-09-2007 06:58 AM
I have two Tru64 5.1B servers: let's call them srv1 and srv2. I have a file on srv2 called /tmp/junk that contains the text:
Hello World?
On srv1 I have a file called /tmp/junk that contains the text
Goodbye!
From srv1, if I execute
scp2 /tmp/junk user@srv2:/tmp/junk
I wind up with:
Goodbye!
ld?
(the first 9 characters of the target file are replaced with the 9 characters of the source file, including the newline, and the remaining 4 characters of the target file remain, including the newline)
Is this expected? What is the best way to ensure that the target file is completely overwritten (like in cp)?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2007 10:01 AM
тАО10-09-2007 10:01 AM
Re: scp2 not completely overwriting a file?
one system talking to itself:
urtx# echo long-long-long > /tmp/sc_l
urtx# echo short > /tmp/sc_s
urtx# ls -l /tmp/sc_*
-rw-r--r-- 1 root system 15 Sep 14 11:03 /tmp/sc_l
-rw-r--r-- 1 root system 6 Sep 14 11:03 /tmp/sc_s
urtx# cat /tmp/sc_*
long-long-long
short
urtx# scp2 /tmp/sc_s root@urtx:/tmp/sc_l
root@urtx's password:
sc_s | 6B | 0.0 kB/s | TOC: 00:00:01 | 100%
urtx# ls -l /tmp/sc_*
-rw-r--r-- 1 root system 6 Sep 14 11:04 /tmp/sc_l
-rw-r--r-- 1 root system 6 Sep 14 11:03 /tmp/sc_s
urtx# cat /tmp/sc_*
short
short
That is, no problem.
urtx# sizer -v
HP Tru64 UNIX V5.1B (Rev. 2650); Mon Feb 19 11:57:07 CST 2007
urtx# scp2 -V
scp2: SSH Secure Shell Tru64 UNIX 3.2.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2007 09:05 PM
тАО10-09-2007 09:05 PM
Solutionno, you're not the only one who discovered this problem.
There is a bug in scp2 which is fixed in Tru64 V5.1B-4 (PK6 BL27)
If you're running BL26 (PK5) there exist a patch which solves the problem.
(check with dupatch -track -type kit -nolog)
http://h30097.www3.hp.com/unix/erp/c00553244.html
PatchID: T64KIT1000096-V51BB26-E-20051110
cheers
Reto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 01:44 AM
тАО10-10-2007 01:44 AM
Re: scp2 not completely overwriting a file?
circumstances, scp2 or sftp2 can copy files incorrectly.". I was wondering if you saw any more specific information or if you encountered this behavior yourself.
Steven: Thanks for the effort. Do you have the patch the Reto mentions installed?
I will leave this thread open a little longer before awarding points and closing it out. Thanks again for the timely responses!
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 04:26 AM
тАО10-10-2007 04:26 AM
Re: scp2 not completely overwriting a file?
> mentions installed?
I have PK6 installed, which might explain
why my "sizer -v" output differs from yours.
Except that we haven't seen yours, so we
can't tell. If you want to do something
useful, you could see what _your_ "scp2 -V"
says, too, which might provide another clue.
"5.1B", while interesting, is not a very
complete description of your environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 04:58 AM
тАО10-10-2007 04:58 AM
Re: scp2 not completely overwriting a file?
Here is what I have:
/]/usr/sbin/sizer -v
Compaq Tru64 UNIX V5.1B (Rev. 2650); Fri Nov 3 21:57:19 EST 2006
/]scp2 -V
scp2: SSH Secure Shell Tru64 UNIX 3.2.0
which looks like your values above...
But if you have PK6, that would be consistent with Reto's info above, and would explain why it works OK for you.
Thanks again for your timely assistance. I think I am going to get our systems patched and test it out. I will report back.
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 05:07 AM
тАО10-10-2007 05:07 AM
Re: scp2 not completely overwriting a file?
Just as a note for anyone else encountering the same problem, the workaround I am employing until I get the patch installed and tested is to execute:
ssh2 user@srv2 "rm /tmp/junk"
then to perform the copy.
I am curious about what other behaviors are associated with this patch, and under what "circumstances" the behaviors occur, so I could be sure that this workaround is valid.
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 09:16 AM
тАО10-10-2007 09:16 AM
Re: scp2 not completely overwriting a file?
Yeah. Sadly, terms like "V5.1B-4" are used
only for marketing, so if you want more
valuable info, you need to do something like:
/usr/sbin/dupatch -track -type patch_level | grep -i 'patch kit'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2007 08:11 PM
тАО10-10-2007 08:11 PM
Re: scp2 not completely overwriting a file?
as I've said, this is not a workaround, it's exactly the solution to your problem.
As I can remember correctly the problem with scp2 came into PK5. The problem was related how we copy files.... If you copy a smaller file to a bigger one which already exist, we didn't replace the file, we just wrote sequential to the file. So at the end we still have the rest of old content in the original bigger file. => which is fixed with mentioned early release patch.
sizer -v doesn't tell you on which patchlevel you stay. dupatch -track -type kit -nolog does it for you.
(sometimes we don't want to tell customers what bugs we've done exactly:)
cheers
Reto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-11-2007 12:52 AM
тАО10-11-2007 12:52 AM
Re: scp2 not completely overwriting a file?
Reto: I am sorry, I was unclear in my comments above. I was referring to my workaround (using ssh to remove the file before initiating the copy). I believe that your suggestion is the solution, I just am using my workaround until I can get to implementing the patch. Based on your subsequent comments, I am confident in my workaround until I can get the patch installed (hopefully this weekend).
I will leave this thread open until I get the patch installed and will confirm success.
Thank you both for your attention. I hope I am able to return the favor sometime.
Scott