LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Delete files in folder before todays date (https://www.linuxquestions.org/questions/linux-newbie-8/delete-files-in-folder-before-todays-date-755023/)

dave7802 09-14-2009 04:26 AM

Delete files in folder before todays date
 
Hello all,
New here and a nice place you have here,

i have a quick question i am use one of you wizzy guys can help me with

I currently have a command to backup a directory it will zip the directory
and place it where i have told it too,

Now what i am after is a command i can run before my code,
that will delete and tar.gz files before todays date
so i my ideal world :p

it would be something like this,

delete <'date +%m_%d_%y'.tar so this will delete all the files in this folder before todays date,

this make sence....

thanks in advance if anyone is able to help me :-)

acid_kewpie 09-14-2009 05:03 AM

find -daystart -ctime +0 -exec rm -f {} \;


should do it.


All times are GMT -5. The time now is 03:55 AM.