delete files one day old in current month only

i want to delete files that are one day old
condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)}
any modifications to
find $DIR -type f -atime +1 -exec rm -f{}\;

I think you want to use -mtime -1 or perhaps the -newer option.

can u elaborate on -newer option!!!
thanks

You want to stop a command from working on the first of the month. In ksh, one way is:
(($date +%d)!=1)) && command

But next we have another problem: suppose that
find $DIR -type f -mtime +1 -exec rm -f {} \;
runs on the 2nd day of the month. Those files from the last day of the last month will now be deleted. Is that acceptable? I don't know if you want to keep feb 29 files forever, or just give them a one day extention.

By switching to mtime we are looking at when the file was last modified. If you use atime, you are looking at when it was last read. Does reading a file really qualify it for an extention?

Also:
-mtime 0 means files less than 24 hours old
-mtime 1 means files more than 24 but less than 48
-mtime 2 means files more than 48 but less than 72

-mtime +1 means 48 hours or older

And it is how old from when the command was run. It is not midnight to midnight. You need to be precise.

maverick, the -newer option is explained in the man page for "find".

To avoid erasing files from the last month, you could make a script that compares the date of the file [ l someFile | awk '{print $6}' ] to the current month [ date +%h ].