Compress folders older than x days

hello everyone.
in /opt/abc every night there is a new folder created. in that folder there is aseries of files created for that day.
i would like to run a script every Sunday night at 02:00 to compress each file separately (preserving its name) who is older than 2 days.
i have found this command
find /opt/abc/ -mtime +2 | xargs tar -czvPf /opt/older_log_$(date +%F).tar.gz

but i do not know how to edit it to make suitable for my needs. I would appreciate any help available.
Thanks in advance.

Each file separately gziped

find /opt/abc/ -type f -mtime +2 \! -name '*.gz' -exec gzip {} \;

Please also note that if have alot of files, you will gain performance by replacing \; with \+ in MadeinGermany find statement, since gzip can accept multiple files as arguments.

Use cron to run that at desired times.

Gzip will also ignore gz suffixed files, printing that on stderr.

Regards
Peasant.

2 Likes