Not sure what your objective is or whether the logic of your "if" is what you want.
What you are doing: If there is anything in folder1 that was last modified at least 3 days ago, then remove it and drop out of that whole segment of script you are showing. If (and only if) nothing was found in folder1, then -> if there is anything in folder2 that was last modified at least 3 days ago, then remove it, do the curl command, and drop out of that whole segment of script you are showing. If nothing is found in either folder, do nothing.
If your intention is to remove things older than three days from both folders, then getting rid of the whole "if" structure would simplify things. Is the curl just to say that you did it? If so, then the following would work.
Code:
find /backup/server/folder1 -type f -mtime +3 -exec rm -rf {} \;
find /backup/server/folder2 -type f -mtime +3 -exec rm -rf {} \;
curl http://intserver.com/check.php?pid=111
You could even change those two finds to one line
Code:
find /backup/server/folder1 /backup/server/folder2 -type f -mtime +3 -exec rm -rf {} \;
Unfortunately, if you want to know whether anything was found, it gets more complicated. The linux man page for find indicates the following about the exit status:
Code:
find exits with status 0 if all files are processed successfully, greater than 0 if
errors occur. This is deliberately a very broad description, but if the return value
is non-zero, you should not rely on the correctness of the results of find.
Playing around with some test cases indicates that your "if" structure will always execute the first case and never check folder2 or do the curl, unless, of course, your script encounters an error, such as access denied to folder1.