[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Effacer les fichiers qui datent de x jours...
- To: linux-31@culte.org
- Subject: Re: Effacer les fichiers qui datent de x jours...
- From: Jean-Marc MONGRELET <jeanmarc.mongrelet@free.fr>
- Date: Sun, 11 Apr 2021 19:16:11 +0200
- Authentication-results: pic2s.le-pic.org; dkim=pass (2048-bit key; unprotected) header.d=free.fr header.i=@free.fr header.b="ctNTFqxj"; dkim-atps=neutral
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1618161372; bh=yvGsTYPaUcdcD0vZ5siH502Y5g/IBV+eBd06iuvwnBI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=ctNTFqxjKmTyyJVNFqBJaXKHw5t+0Zkh6cEcB2eRbStYEbTWtu/d8hyqHLbTsxvWq bZXk1JtyuhqIdJaKPR7r8cgieL05sXMVXqC7zPZgcazfyk4joY535a9o9hlszfD2aB 02fmT4dhW7KPmUfNxqnkugOyWhN1hVJIVH++emesj3sxaTt6cwZpYTfP3aw7N20by4 maBH9EZWMd7Ga5jzRI03UOwOW+pn1IU61CiBrcbPTQrga3SEkL+aFEuJ7EIti81swm bMFprNbvUN8NqheQ8ZGI8AjdBUMPUKci5oEUi4cj2SQT7P+tY2FbZOsUDsL8A/1Uug bLfZrUcnqajjA==
- In-reply-to: <1969953714.382669630.1618155404408.JavaMail.root@zimbra19-e3.priv.proxad.net>
- References: <1969953714.382669630.1618155404408.JavaMail.root@zimbra19-e3.priv.proxad.net>
- User-agent: Roundcube Webmail/1.4.11
Le 11/04/2021 17:36, Bernard Schoenacker a écrit :
Sorry, why do not consult the web and the rtfm ?
the answer are disponible on this website :
https://www.2daygeek.com/bash-script-to-delete-files-folders-older-than-x-days-in-linux/
https://stackoverflow.com/questions/13489398/delete-files-older-than-10-days-using-shell-script-in-unix#13489511
Okay... Le secret c'est "-mtime +7" dans la commande find:
find ./ -type f -mtime +7
Donc pour effacer, en tenant compte des fichiers qui ont des espaces
dans le nom... ça donne ça:
find ./ -type f -mtime +7 -print0 | xargs -0 -l rm
JM