Command for delete the directories which are older than 7 days

Hi,

My requirement is need to delete the directories (Including files also) which are older than 7 days. So I used below command in one script (script takes 2 input parameters)

#$1 - Path of the directory from where we have to delete the directories.#

#$2 - Number of days older directories to be deleted#

find $1 -type d -mtime +$2 -exec rm -r {} \;

The issue is this command is working fine, but when it deletes directory(Ex: XYZ directory) after some time(after 12 hrs) again XYZ gets created with different modification time and this directory is showing some size(Actually this directory files are deleting). So the question is why this directory is recreating? actually we do not want it.

Please let me know if any body have same experience in past.

Thanks

The filesystem is not recreating the directory.
Possibilities:

  1. some script or application recreates them with the same name
  2. they are being restored from a tarball or "saveset" somewhere