Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tool um Dateien zu löschen die älter sind als ....[solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Der_Biber
n00b
n00b


Joined: 14 Jan 2003
Posts: 26

PostPosted: Tue Oct 04, 2005 12:42 pm    Post subject: Tool um Dateien zu löschen die älter sind als ....[solved] Reply with quote

Hi

ich suche ein Kommandozeilen-Tool, das mir alle Dateien (in einem Ordner) löscht die älter sind als ein bestimmtes Datum....
Da gibt es doch bestimmt was :roll:

Danke


Last edited by Der_Biber on Sat Oct 08, 2005 6:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
chrib
Guru
Guru


Joined: 27 Sep 2003
Posts: 558
Location: Berlin, Germany

PostPosted: Tue Oct 04, 2005 1:01 pm    Post subject: Reply with quote

ungetestet, also vorher mal in nem Testverzeichnis ausführen.
Code:
touch -t YYMMDDhhmm wegmitdemaltenmuell

und
Code:
 find . ! -newer wegmitdemaltenmuell -exec rm {} \;


Ansonsten, man touch, man find
_________________
Der Mensch kämpft um zu überleben, und nicht, um zu Grunde zu gehen. - Paulo Coelho
It is the end of all hope. To lose the child, the faith. To end all the innocence. To be someone like me. - Nightwish - End of all hope
Back to top
View user's profile Send private message
ckoebke
n00b
n00b


Joined: 22 Aug 2005
Posts: 4

PostPosted: Tue Oct 04, 2005 1:10 pm    Post subject: Reply with quote

man find :)

bei suche nach create time (datum der erstellung des files)

find <ordner> -ctime +7 -exec rm{} \; # File status was changed 7*24h ago

find <ordner> -mtime +7 -exec rm{} \; # File data was last modified 7*24h ago

find <ordner> -atime +7 -exec rm{} \; # File was last accessed 7*24h ago

je nachdem was du von den Beispielen brauchst werden Dateien im <ordner> (und darunter) älter 7 tage gelöscht.
Back to top
View user's profile Send private message
tam
Guru
Guru


Joined: 04 Mar 2003
Posts: 569

PostPosted: Tue Oct 04, 2005 8:26 pm    Post subject: Reply with quote

Genau das, was Du suchst
Code:
app-admin/tmpwatch

_________________
http://tam.belchenstuermer.de/
Back to top
View user's profile Send private message
ChrisM87
l33t
l33t


Joined: 07 Aug 2004
Posts: 728
Location: Rheinland-Pfalz (Germany)

PostPosted: Tue Oct 04, 2005 8:34 pm    Post subject: Reply with quote

Hi,

auch das gleiche:
emerge tmpreaper

Chris
_________________
born to be root - sorry for my bad English!
Back to top
View user's profile Send private message
Der_Biber
n00b
n00b


Joined: 14 Jan 2003
Posts: 26

PostPosted: Wed Oct 05, 2005 12:34 pm    Post subject: Reply with quote

Danke!

tmpwatch... genau das hab ich gesucht! :D
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3925
Location: Hamburg

PostPosted: Wed Oct 05, 2005 3:20 pm    Post subject: Reply with quote

ckoebke wrote:
man find :)
find <ordner> -ctime +7 -exec rm{} \;

Da fehlt noch ein Leerzeichen zwischen rm und {}, außerdem sollte {} als '{}' geschrieben werden, nur für den Fall, daß ja jemand Leer- oder Sonderzeichen in dem Dateiname verwendet hat.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum