Jump to content

Linux ZIP - skip errors


Splash

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.