i need to create new script if the image not present in real folder and not in used than delete from cache folder
example
Cach folder image pub/media/catalog/product/cache/2a584e14ed2061ee0dac7db2e52f28f9/1/_/1_asc-d-404-mn_dollcarrier_minnie_2000.jpg
“pub/media/catalog/product/1/_/1_asc-d-404-mn_dollcarrier_minnie_2000.jpg”
if this image not present in => “pub/media/catalog/product/”
than delete from => “pub/media/catalog/product/cache”
this kind of script i need to create can any one help me how can i archive this