Re: tftpboot cleanup script draft
David Quenzler <quenzler-r/[email protected]>
| Newsgroups | gmane.linux.terminal-server.devel |
|---|---|
| Message-ID | <OFC134F7D6.C5170081-ON852574AE.004ED57C-852574AE.005441BE@us.ibm.com> |
Warren,
Are there any files containing $version that we'd want to keep? (e.g.
abi-$version or *version.bak)
A better way might be to use 'find', e.g.
+=====+
#!/bin/sh -x
TFTPDIR=/var/lib/tftpboot
for kernelpath in $(find $TFTPDIR/ltsp -name vmlinuz-*); do
arch=$(basename `dirname $kernelpath`)
kernel=$(basename $kernelpath)
version=${kernel##vmlinuz-}
#if [ ! -d /opt/ltsp/$arch/lib/modules ]; then
#echo "delete these files..."
#find $TFTPDIR/ltsp/$arch -name *$version* | xargs -n1 rm -vrf
#fi
done
+=====+
Finding vmlinuz- files will bypass the empty directories. I don't like
the way I derive arch, but it works.
The last 'find' could be as above or
find $TFTPDIR/ltsp/$arch | grep $version
A removal method could be as above or
rm -rvf `find....`
Just a few ideas as long as we're not that picky about which $version
files we delete.
- Dave
ltsp-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote on 08/22/2008 06:28:18
PM:
> Attached is an early draft of the tftpboot cleanup script.
>
> It should theoretically be safe. But can anybody think of a better way
> other than the wildcard and grep scraping to safely loop through all
> directories or vmlinuz-* files even if you have no matches?
>
> After we clean this up I aim on adding this inside the
> ltsp-update-kernels script.
>
> Warren Togami
> [email protected]
> [attachment "cleanup.sh" deleted by David Quenzler/Poughkeepsie/IBM]
>
-------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> Build the coolest Linux based applications with Moblin SDK & win great
prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _____________________________________________________________________
> Ltsp-developer mailing list. To un-subscribe, or change prefs, goto:
> https://lists.sourceforge.net/lists/listinfo/ltsp-developer
> For additional LTSP help, try #ltsp channel on irc.freenode.net
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_____________________________________________________________________
Ltsp-developer mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help, try #ltsp channel on irc.freenode.net