[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run-parts man ?



> On Sun, 8 Jul 2001, Ben-Nes Michael wrote:
> 
> > Hi All
> > 
> > I sow "run-parts" in /etc/crontab, I guess it activate script script in
> > directory but im not sure.
> > 
> > I tried my man system and other on the web with no success.
> > 
> > Any one know where I can find the run-parts man or what it does ?
> > 
> > man -K "run-parts" didn't helped either :(
> 
> That is indeed a problem with the distro, but...
> 
>   $ which run-parts
>   /usr/bin/run-parts
>   [tzafrir@canada1 Mozilla]$ file `which run-parts
>   $ file `which run-parts`
>   /usr/bin/run-parts: Bourne-Again shell script text executable
>   $ wc `which run-parts`
>        30      94     505 /usr/bin/run-parts
> 
> Doesn't look as if it would be too hard to grasp on your own. Anyway,
> here's run-parts of my system:
> --------
> #!/bin/bash
> 
> # run-parts - concept taken from Debian
> 
> # keep going when something fails
> set +e
> 
> if [ $# -lt 1 ]; then
>         echo "Usage: run-parts <dir>"
>         exit 1
> fi
> 
> if [ ! -d $1 ]; then
>         echo "Not a directory: $1"
>         exit 1
> fi
> 
> for i in $1/* ; do
>         [ -d $i ] && continue
>         # Don't run [KS]??foo.{rpmsave,rpmorig,rpmnew} scripts
>         [ "${i%.rpmsave}" != "${i}" ] && continue
>         [ "${i%.rpmorig}" != "${i}" ] && continue
>         [ "${i%.rpmnew}" != "${i}" ] && continue
> 
>         if [ -x $i ]; then
>                 $i
>         fi
> done
> -----------
> 
> So basically it runs all the executables from a given directory
> 
> -- 
> Tzafrir Cohen
> mailto:tzafrir@technion.ac.il
> http://www.technion.ac.il/~tzafrir
> 


It look like this is distro dependant:

[23:10:59 tmp]$ locate run-parts
/bin/run-parts
/usr/share/man/man8/run-parts.8.gz
[23:12:44 tmp]$ file /bin/run-parts
/bin/run-parts: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), stripped
[23:12:53 tmp]$ dpkg -S /bin/run-parts 
debianutils: /bin/run-parts

run-parts.8.gz


	Shaul Karl <shaulka@bezeqint.net>

Hillel used to say: If I am not for myself who will be for me?
Yet, if I am for myself only, what am I? And if not now, when?
                                          (Ethics Of The Fathers 1:14)