I tried the below code to remove the files older that 30 days .
#!/bin/ksh
set -x
file_path1="/home/etc"
file_path2="/home/hst"
file_nm="HST"
days=30
find $file_path1/*$file_nm* -type f -mtime +$days -exec rm -f {} \;
find $file_path2/*$file_nm* -type f -mtime +$days -exec rm -f {} \;
The file with the abvoe required name doesn't exist in the past 30 days .
But still I want the script to run by ignoring the following error .
The following error stops executing the another find command in my script .
Error is:
find: stat() error /home/etc/*HST*: No such file or directory