[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


=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il