Bash script - find command with delete and exec

hi all,

i have devised a script that starts in /restored/ and in there, there are a lot of sub folders called peoples names and in the sub folders are files/folders and it deletes the data in the sub folders BUT not the sub folder itself and it should then touch a file in all the sub folders warning people files/folders get deleted in x days time

it all works apart from the touch command, if i change the mindepth to 1 it works but when i change it to 2 it doesnt

below is my script -

cd /restored/
find -mindepth 2 -exec rm -rf {} \;
find -mindepth 2 -type d -exec touch WARNING_everything_in_here_will_get_removed_in_14_days_time.txt {} \;

can anyone please help me out, i would be very gratefull

many thanks,

rob

I'm pretty sure some structuring of your text with e.g. punctuation would certainly enhance readability and understandability. And, posting WHAT "doesn't" could point helpers in the right direction. What be the difference when running it with mindepth 2 as compared to mindepth 1 ?
Would it help to put the {} in front of the file name to be touch ed?

find  -mindepth 2 -type d -exec echo touch WARNING_everything_in_here_will_get_removed_in_14_days_time.txt {} \;
touch WARNING_everything_in_here_will_get_removed_in_14_days_time.txt ./test/test1
touch WARNING_everything_in_here_will_get_removed_in_14_days_time.txt ./test/test1/test3
touch WARNING_everything_in_here_will_get_removed_in_14_days_time.txt ./test/test2

find  -mindepth 1 -type d -exec echo touch {}/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt \;
touch ./test/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt
touch ./test/test1/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt
touch ./test/test1/test3/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt
touch ./test/test2/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt

You might want to make sure everybody knows when the 14 days will be over ...

got the stupid syntax wrong using the find touch command

cd /restored/
find -mindepth 2 -mtime +13 -exec rm -rf {} \;
find -type d -exec touch {}/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt \;

As a safety measure ensure that the cd was successful.

if cd /restored/
then
  find -mindepth 2 -mtime +13 -exec rm -rf {} \;
  find -type d -exec touch {}/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt \;
fi