Holy ****. I hope you never produce such code in production environments. It's completely illegible. Your variable names are horrible. I can figure out what "d", "m" and "y" do, "s" probably as well, but "g", "b", "sr" or "r"? And you do know that this isn't C, and you can declare variables in a for loop? That way you can move the declaration of "i" to the loop: I'm going to try to figure out what your code does, but I fear it's going to be harder than necessary. Properly named variables would make it soooo much easier.
However, I think I know a better way. Using File.listFiles() and File.lastModified() you can quite easily find all files older than 7 days*. A quick attempt, assuming all files are in the same folder:
You can improve the filter to perhaps use a regex to make sure the file names also have a proper format.
* The best way is to use Calendar, but in this case I doubt that 24L * 60L * 60L * 1000L * 7 will be a problem. (The L's are to ensure the result is a long; without they are treated as ints and you'll get overflow.)