Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

bash script for cleaning distfiles in gentoo (See related posts)

Bash script for cleaning /usr/distfiles in gentoo.
Usually this folder is located in /usr/portage/distfiles, but i moved it ;)
The script will delete every file, that has not been accessed in 90 days,
without deleting my wifi-driver (ipw3945).

#!/bin/bash

for i in \
`find /usr/distfiles -maxdepth 1 -atime +90 \
| grep -Ev "/usr/distfiles/\..*" \
| grep -v "ipw3945"` \
; do
    if [ -f $i ]; then
        rm $i; 
    fi 
done

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts