user3378876 user3378876 - 7 months ago 75
Bash Question

zip error - Nothing to do

I try to zip all folders in given directory. So I wrote this

find /home/user/rep/tests/data/archive/* -maxdepth 0 -type d -exec zip -r "{}" \;

but got

zip error: Nothing to do! (/home/user/rep/tests/data/archive/

zip error: Nothing to do! (/home/user/rep/tests/data/archive/

here is what this contains

user@machine:~$ ls /home/aliashenko/rep/tests/data/archive/
tmp tmp_dkjg tmp_dsf


The issue is that you have not provided a name for the zip-files it will create.

find /home/user/rep/tests/data/archive/* -maxdepth 0 -type d -exec zip -r "{}" "{}" \;

This will create separate zipped directories for each of the subfolders tmp tmp_dkjg and tmp_dsf