Splash Posted February 23, 2010 Share Posted February 23, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/193048-linux-zip-skip-errors/ Share on other sites More sharing options...
tallship Posted March 4, 2010 Share Posted March 4, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/193048-linux-zip-skip-errors/#findComment-1021444 Share on other sites More sharing options...
Splash Posted March 5, 2010 Author Share Posted March 5, 2010 Perfect thanks tallship Quote Link to comment https://forums.phpfreaks.com/topic/193048-linux-zip-skip-errors/#findComment-1022007 Share on other sites More sharing options...
tallship Posted March 6, 2010 Share Posted March 6, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/193048-linux-zip-skip-errors/#findComment-1022198 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.