delete file older than N days

Hi, All,
I'd like to delete files older than 1 day.

I thought the following command

find /your_directory -mtime +1-exec rm -f {} \;

will do the work, but not so, it seems like it won't delete files unless it is 2 days old or older. the files between 1 day and 2 days old does not get deleted, so does +1 actually means 2 days? if not so, why it won't delete files between 1 and 2 days old? can someone please help me?

Hi, All,
I'd like to delete files older than 1 day.
I thought the following command :

find /your_directory -mtime +1-exec rm -f {} \;

will do the work, but not so, it seems like it won't delete files unless it is 2 days old or older. the files between 1 day and 2 days old won't get deleted, so does +1 actually means 2 days? if not so, why it won't delete files between 1 and 2 days old? can someone please help me?

That command will delete anything that is older than 24 hours from when the command was run.

Erika,
As you said:

Yes, the "find" has three options for number of days:
1) +n --> More than 'n' days ago.
2) -n --> Less than 'n' days ago.
3) n ---> Exactly 'n' days ago.

Thus, if you specify '+1', it means more than 1 day ago.

Actually, date ranges in the find command do not work quite how you expect them to.

1 means 24 hours old
-1 means less than 24 hours old
+0 means more than 24 hours old
+1 means more than 48 hours old

Demonstration at the ksh prompt...

$ for i in 09 10 11 12;do touch -t 200707${i}0000  July_${i};done
$ ls -o
total 0
-rw-r--r--    1 Ygor          0 Jul  9 00:00 July_09
-rw-r--r--    1 Ygor          0 Jul 10 00:00 July_10
-rw-r--r--    1 Ygor          0 Jul 11 00:00 July_11
-rw-r--r--    1 Ygor          0 Jul 12 00:00 July_12
$ for j in 1 -1 +0 +1;do echo "[[ ${j} ]]";find . -type f -mtime ${j} -print;done
[[ 1 ]]
./July_11
[[ -1 ]]
./July_12
[[ +0 ]]
./July_09
./July_10
./July_11
[[ +1 ]]
./July_09
./July_10

The reason is that "+1" means 2 or more days old, i.e. more than 48 hours old.

if you need to be really precise I usually do summink like:

touch -t YYYYMMDDhhmmss 111
find . -older 111 | xargs rm

Actually, i wanted know about the cron entry path in my UNIX server?
if i issued the crontab -l it will listout the all cront entries in the current server, But i wanted to know about the PATH where all the cron entries is stored?

Please, any one help me.

Thanks,
Siva.P

This is the path where the crontab enteries are stored..
/var/spool/cron/crontabs