Zip error - do nothing

I try to pin all folders in a given directory. Therefore 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)

that's what contains

user@machine:~$ ls /home/aliashenko/rep/tests/data/archive/
tmp  tmp_dkjg  tmp_dsf
+4
source share
1 answer

The problem is that you did not specify a name for the zip files that 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_dkjgandtmp_dsf

+3
source

Source: https://habr.com/ru/post/1657523/


All Articles