LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Purge data command (https://www.linuxquestions.org/questions/linux-newbie-8/purge-data-command-799003/)

simransab 03-30-2010 08:01 PM

Purge data command
 
Hi,

I have data in linux box that is transfered from 1 server to another..
Before transfer , i will keep a copy in "Backup" folder. What is the command to purge data older than 3 days?

Thanks,
Sab

simransab 03-30-2010 08:36 PM

Guys, i found it:
/usr/bin/find /data/logs -name "*" -type f -mtime +31 -print -exec /bin/rm -f {} \;

grail 03-31-2010 12:06 AM

Glad you found it. Please mark as SOLVED (thread tools)

Tinkster 03-31-2010 12:50 AM

Quote:

Originally Posted by simransab (Post 3918599)
Guys, i found it:
/usr/bin/find /data/logs -name "*" -type f -mtime +31 -print -exec /bin/rm -f {} \;

Code:

-name "*"
is superfluous, and chances are that replacing the
Code:

-exec rm {} \;
with
Code:

| xargs rm
will be quicker.


Cheers,
Tink


All times are GMT -5. The time now is 12:04 PM.