Jump to content

Recommended Posts

Hiya,

 

I'm trying to zip a directory using the following command:

 

zip -r0 zipfile mydir

 

However there's a file I get an error on whilst the zipping takes place. This causes the command to stop.

 

Is there any way to tell the command to skip errors?

 

I've tried 'man zip' but I can't find anything.

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/193048-linux-zip-skip-errors/
Share on other sites

  • 2 weeks later...

Hiya,

 

I'm trying to zip a directory using the following command:

 

zip -r0 zipfile mydir

 

try tar and gzip instead. the command would be:

 


$ tar cvf mystuff.tar /path/to/your/directory
$ gzip mystuff.tar

 

This will yield a file named mystuff.tar.gz - it's the standard for zipping things up and if you're moving it to wyndoze your winzip or winrar will handle unpacking the archive too. These utilities have better algorithms for handling files. I believe you 'can' force it too, but I would try moving those files somewhere else with the 'mv' command before trying that.

 

It may be that you're file is on a bad block or is otherwise corrupted and sometimes moving it will take care of that.

Glad I could help out :)

 

BTW, you can unzip easily with one command instead of two by placing the archive into a directory that you would like the zipped up directory to appear under by entering:

 


$ tar zxvf mystuff.tar.gz

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.