943,752 Members | Top Members by Rank

Ad:
Jul 13th, 2009
0

Problem updating zip file?

Expand Post »
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
Similar Threads
Reputation Points: 7
Solved Threads: 2
Junior Poster
HLA91 is offline Offline
177 posts
since Oct 2006
Jul 13th, 2009
0

Re: Problem updating zip file?

I dont think your command worked:
bash Syntax (Toggle Plain Text)
  1. sk@sk:~/zip$ zip backup .
  2.  
  3. zip error: Nothing to do! (backup.zip)

What I did to create the zip archive:
bash Syntax (Toggle Plain Text)
  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:
bash Syntax (Toggle Plain Text)
  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.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Applications and Software Forum Timeline: .ithmb conversion
Next Thread in Linux Applications and Software Forum Timeline: rndc: connect failed: 127.0.0.1#953: connection refused





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC