I was trying to tar a file and ended up overwriting it. I was working in Xcode and I'm wondering if there is a way for me to recover the overwritten file.
A:
Yes, from your backups which, of course, you do regularly and frequently, right?
On second thoughts, you probably don't, so you're fresh out of luck.
I'd look on this as an opportunity to change your backup practices :-).
paxdiablo
2009-02-11 05:34:50
Jeez... kick him while he's down, why dontcha? :P
Sean Bright
2009-02-11 05:36:48
The best thing about kicking people when they're down is that you can usually get away before they get up again. The best thing about kicking people when you're climbing the corporate ladder is that you can kick them on the way down as well :-).
paxdiablo
2009-02-11 05:38:49
What if the tarring was part of his backup process?
Andrew Grimm
2009-07-14 02:03:12
@AndrewG, I can't tell whether you're trying to be funny or not :-) Most people would keep their previous backups well away from the computer being backed up. They certainly would stage their backups by giving them filenames with the date in them, otherwise massive failure during the backup process would result in backup and data being lost.
paxdiablo
2009-07-14 03:36:27
A:
If you mean that you added the same file twice in a tar archive, chances are that you can recover it: tar never overwrite, it appends. And when extracting it extract both which may result in an overwrite.
If you mean that you extracted a file from a tar archive and overwrote another in the process, unfortunately your only chance is backups. Maybe Time Machine is up on your Mac or you are using a SCM for your developer tasks.
mouviciel
2009-02-11 06:06:29