In /opt/abc
I have a path where a new folder gets created daily. In that folder a series of files gets created.
I would like to run a script every Sunday at 02:00 and compress each folder which is older than 2 days. I would not like to have everything compressed to one folder, but each folder to get compressed individually. If the compression is successful, then the original folder can be deleted.
I have tried to create a script but all it does is to compress them to a single file. also it does not delete the original folders.
How should I proceed?
--strip-components
option, set the option's argument as 2, and it will remove the/opt/abc/
part of the path. – Arronical Jul 03 '15 at 14:38