Trying to zip a backup directories inside a parent directory data/ which looks like this
data |- 2019-04-01 |- data.gz |- data2.gz |- 2019-04-09 |- data.gz |- data2.gz I would like to zip the timestamped directories in same named zips and delete the unzipped directories
data |- 2019-04-01.zip |- 2019-04-09.zip I have tried this find command to zip them but I'm having a no such file error find . -type d -execdir zip -r {}.zip {} ';' What am I doing wrong on this command?
-execdirand then do-delete, note that-execdiris probably useless, use-execinstead, since you appear to be indata/already ?-execdiris fine here. @spy-killer Your command works, but you should use-mindepth 2 -maxdepth 2to not also zip data and.folders.data/.