Bug 4740 - Disable backup scripts in 'run-parts'
Summary: Disable backup scripts in 'run-parts'
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: crontabs
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-08-27 07:11 UTC by jaro
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-04-10 22:01:10 UTC


Attachments (Terms of Use)

Description jaro 1999-08-27 07:11:23 UTC
I propose a slight modification to the run-parts script,
to disable running backup scripts in the /etc/cron.*
directories.  This is accomplished with the following
version:

#!/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            # Don't run shell backups
(ending to ~)
        [ -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

exit 0

Comment 1 Jeff Johnson 1999-08-27 14:07:59 UTC
Fixed in crontabs-1.7-7. Thanks for noticing.


Note You need to log in before you can comment on or make changes to this bug.