> > I think ideally, checkfreespace would have to determine which filesystem the > > purge-able files reside on. One of my major goals for a new distribution is > > to gracefully support flexible mount-points. While the purge-able files may > > not change, and so could be included as part of the package itself, there's > > no way for a package to know ahead of time exactly which file-system the > > files will reside on. > > I didn't want to assume; but, that direction makes sense if packages are > to contain purgeable file definitions. > > Is it fair to say that *all* applicable filesystems are ramdisks and, > therefore, can be identified according to form: /dev/ramX ?
No. Even in existing systems, some folks have hard-disks, or will leave the floppy or CD-ROM drive mounted. The CD-ROM causes problems, as it's always 100% full. Systems may also be using flash disks (MTD), Disk-on-Chip (M-systems or MTD driver), and other devices for storage. > The tools available are busybox grep and sort, and real sed? Plus ash (the built-in string handling is quite powerful, once you get the hang of it...see the sh-httpd script for some examples). In general, I'd say anything that's on Dachstein right now would be usable, but stick with the ash subset of available bash commands. > Once I define the requirements, then I can build it . . . I'm envisioning something like: df indicates a partition is past is usage limit...mount points saved for use later /proc/mounts checked to verify partition is RW purgable file list built from "/etc/purge.d" directory or similar. Remember, sed can be very powerful for things like this... <segway> Assume a directory of files, with each file containing entries (one per line), consisting of two fields, a number (the purge-level), and a file-spec (wildcards OK). Check the list of mount-points for any with a leading portion that matches the over-full mount point (ie /var/log is full, but /var/log/httpd, a seperate mount point, isn't). Add any matching mount points to an exclude list. Build a single sed command to delete any un-desired file specs, and strip off the purge-level...start with /^1/!d (where one is the desired purge level), add delete commands for each sub-mount point (ie \:var/log/httpd:d), and end with a substute command to strip the leading field ( s/^[0-9 <tab>]*// ) and run it on all the purge-able file lists (for FILE in `sed $sedcmd /etc/purge.d/*` ; do rm $FILE ; done) </segway> Verify enough space has been made available on file-system...if not, increase purge-level and repeat... Charles Steinkuehler http://lrp.steinkuehler.net http://c0wz.steinkuehler.net (lrp.c0wz.com mirror) _______________________________________________ Leaf-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-devel