Problem updating zip file?

Thread Solved

Join Date: Oct 2006
Posts: 179
Reputation: HLA91 is an unknown quantity at this point 
Solved Threads: 2
HLA91 HLA91 is offline Offline
Junior Poster

Problem updating zip file?

 
0
  #1
Jul 13th, 2009
Hi all

I just thought about backing up my home directory to a zip file so I used

zip backup-13-jul-09 .

Then I read about the argument so I found a file called readme.txt in my home directory opened it and added "Hello World" to the bottom line then performed the
zip -u backup-13-jul-09 .
command but it didn't update the readme.txt file to include "Hello World" on the last line.

Its probably something simple but can someone help me out please?

Many thanks

HLA91
You know your a geek, if you introduce your wife as "mylady@home.wife"
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,187
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 571
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: Problem updating zip file?

 
0
  #2
Jul 13th, 2009
I dont think your command worked:
  1. sk@sk:~/zip$ zip backup .
  2.  
  3. zip error: Nothing to do! (backup.zip)

What I did to create the zip archive:
  1. sk@sk:~/zip$ ls
  2. readme.txt
  3. sk@sk:~/zip$ tail -1 readme.txt
  4. test123
  5. sk@sk:~/zip$ zip -r backup ../zip
  6. adding: ../zip/ (stored 0%)
  7. adding: ../zip/readme.txt (stored 0%)

Now appending text an updating:
  1. sk@sk:~/zip$ cp backup.zip .backup.zip
  2. sk@sk:~/zip$ tail -2 readme.txt
  3. test123
  4. sk@sk:~/zip$ echo "hello, world" >> readme.txt
  5. sk@sk:~/zip$ zip -u backup *
  6. adding: readme.txt (stored 0%)
  7. sk@sk:~/zip$ diff .backup.zip backup.zip
  8. Binary files .backup.zip and backup.zip differ
  9. sk@sk:~/zip$ unzip backup.zip
  10. Archive: backup.zip
  11. warning: skipped "../" path component(s) in ../zip/
  12. creating: zip/
  13. warning: skipped "../" path component(s) in ../zip/readme.txt
  14. extracting: zip/readme.txt
  15. replace readme.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: r
  16. new name: readme2.txt
  17. extracting: readme2.txt
  18. sk@sk:~/zip$ tail -2 readme2.txt
  19. test123
  20. hello, world

I think you probably had an error when you created the archive.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC