user3378876 user3378876 - 1 month ago 21
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/tmp.zip)

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


here is what this contains

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

Answer

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

Comments