Article 58QEP deleting files in directories but with exclusions of some directories

deleting files in directories but with exclusions of some directories

by
goodiemobster
from LinuxQuestions.org on (#58QEP)
Hi,
I'm trying to delete files older then 1 year on a server with +1000 vhosts.

location of the files:
/var/www/vhosts/CLIENT1/httpdocs/files/fotos/
/var/www/vhosts/CLIENT2/httpdocs/files/fotos/
...
/var/www/vhosts/CLIENT1000/httpdocs/files/fotos/

I used to do this with a simple:
find /var/www/vhosts/ -type f -name '*.jpg' -mtime +356 -exec rm {} \;

This worked very good but now some clients don't want these files removed.

Is there a way to exclude multiple /CLIENTX/httpdocs/files/fotos directories?
It would be great if I could put these in a blacklist.txt or something which i can simply adjust before running the removal command.

I'm new here and relatively new to linux, if i did not post this in the right forum, my excuses!latest?d=yIl2AUoC8zA latest?i=zzU2qaY8qlM:l1-hl8Tpc1Y:F7zBnMy latest?i=zzU2qaY8qlM:l1-hl8Tpc1Y:V_sGLiP latest?d=qj6IDK7rITs latest?i=zzU2qaY8qlM:l1-hl8Tpc1Y:gIN9vFwzzU2qaY8qlM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments