diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-03-14 22:29:37 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-03-14 22:31:59 -0400 |
commit | e679b9d14900dfe50a49342172d4397fbcbbb649 (patch) | |
tree | 322d7c9354189ad2e02779c024b648e0b02ae9d5 /sys-process/cronbase/files | |
parent | sys-process/cronbase: mark arm64/ia64/m68k/s390/sh/sparc stable #571134 (diff) | |
download | gentoo-e679b9d14900dfe50a49342172d4397fbcbbb649.tar.gz gentoo-e679b9d14900dfe50a49342172d4397fbcbbb649.tar.bz2 gentoo-e679b9d14900dfe50a49342172d4397fbcbbb649.zip |
sys-process/cronbase: drop old <0.3.7 versions
Diffstat (limited to 'sys-process/cronbase/files')
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.3 | 86 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.4 | 90 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.5 | 106 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.6 | 109 |
4 files changed, 0 insertions, 391 deletions
diff --git a/sys-process/cronbase/files/run-crons-0.3.3 b/sys-process/cronbase/files/run-crons-0.3.3 deleted file mode 100755 index 9b4898a3f214..000000000000 --- a/sys-process/cronbase/files/run-crons-0.3.3 +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# this script looks into /etc/cron.[hourly|daily|weekly|monthly] -# for scripts to be executed. The info about last run is stored in -# /var/spool/cron/lastrun - -LOCKDIR=/var/spool/cron/lastrun -LOCKFILE=${LOCKDIR}/lock - -mkdir -p ${LOCKDIR} - -# Make sure we're not running multiple instances at once. -# Try twice to lock, otherwise give up. -for ((i = 0; i < 2; i = i + 1)); do - ln -sn $$ ${LOCKFILE} 2>/dev/null && break - - # lock failed, check for a running process. - # handle both old- and new-style locking. - cronpid=$(readlink ${LOCKFILE} 2>/dev/null) || - cronpid=$(cat ${LOCKFILE} 2>/dev/null) || - continue # lockfile disappeared? try again - - # better than kill -0 because we can verify that it's really - # another run-crons process - if [[ $(</proc/${cronpid}/cmdline) == $(</proc/$$/cmdline) ]] 2>/dev/null; then - # whoa, another process is really running - exit 0 - else - rm -f ${LOCKFILE} - fi -done - -# Check to make sure locking was successful -if [[ ! -L ${LOCKFILE} ]]; then - echo "Can't create or read existing ${LOCKFILE}, giving up" - exit 1 -fi - -# Set a trap to remove the lockfile when we're finished -trap "rm -f ${LOCKFILE}" 0 1 2 3 15 - - -for BASE in hourly daily weekly monthly ; do - CRONDIR=/etc/cron.${BASE} - - test -d $CRONDIR || continue - - if [ -e ${LOCKDIR}/cron.$BASE ] ; then - case $BASE in - hourly) - #>= 1 hour, 5 min -=> +65 min - TIME="-cmin +65" ;; - daily) - #>= 1 day, 5 min -=> +1445 min - TIME="-cmin +1445" ;; - weekly) - #>= 1 week, 5 min -=> +10085 min - TIME="-cmin +10085" ;; - monthly) - #>= 31 days, 5 min -=> +44645 min - TIME="-cmin +44645" ;; - esac - - find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; &>/dev/null || true - fi - - # if there is no touch file, make one then run the scripts - if [ ! -e ${LOCKDIR}/cron.$BASE ] ; then - touch ${LOCKDIR}/cron.$BASE - - set +e - GLOBIGNORE="*~" - for SCRIPT in $CRONDIR/* ; do - if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then - [ -x /usr/bin/logger ] && /usr/bin/logger -i -p cron.info -t run-crons "(`whoami`) CMD ($SCRIPT)" - $SCRIPT - fi - done - fi -done - -# Clean out bogus cron.$BASE files with future times -touch ${LOCKDIR} -find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; &>/dev/null || true diff --git a/sys-process/cronbase/files/run-crons-0.3.4 b/sys-process/cronbase/files/run-crons-0.3.4 deleted file mode 100755 index 662bd02432bd..000000000000 --- a/sys-process/cronbase/files/run-crons-0.3.4 +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# this script looks into /etc/cron.[hourly|daily|weekly|monthly] -# for scripts to be executed. The info about last run is stored in -# /var/spool/cron/lastrun - -LOCKDIR=/var/spool/cron/lastrun -LOCKFILE=${LOCKDIR}/lock - -mkdir -p ${LOCKDIR} - -# Make sure we're not running multiple instances at once. -# Try twice to lock, otherwise give up. -for ((i = 0; i < 2; i = i + 1)); do - ln -sn $$ ${LOCKFILE} 2>/dev/null && break - - # lock failed, check for a running process. - # handle both old- and new-style locking. - cronpid=$(readlink ${LOCKFILE} 2>/dev/null) || - cronpid=$(cat ${LOCKFILE} 2>/dev/null) || - continue # lockfile disappeared? try again - - # better than kill -0 because we can verify that it's really - # another run-crons process - if [[ $(</proc/${cronpid}/cmdline) == $(</proc/$$/cmdline) ]] 2>/dev/null; then - # whoa, another process is really running - exit 0 - else - rm -f ${LOCKFILE} - fi -done - -# Check to make sure locking was successful -if [[ ! -L ${LOCKFILE} ]]; then - echo "Can't create or read existing ${LOCKFILE}, giving up" - exit 1 -fi - -# Set a trap to remove the lockfile when we're finished -trap "rm -f ${LOCKFILE}" 0 1 2 3 15 - - -for BASE in hourly daily weekly monthly ; do - CRONDIR=/etc/cron.${BASE} - - test -d $CRONDIR || continue - - if [ -e ${LOCKDIR}/cron.$BASE ] ; then - case $BASE in - hourly) - #>= 1 hour, 5 min -=> +65 min - TIME="-cmin +65" ;; - daily) - #>= 1 day, 5 min -=> +1445 min - TIME="-cmin +1445" ;; - weekly) - #>= 1 week, 5 min -=> +10085 min - TIME="-cmin +10085" ;; - monthly) - #>= 31 days, 5 min -=> +44645 min - TIME="-cmin +44645" ;; - esac - - find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; &>/dev/null || true - fi - - # if there is no touch file, make one then run the scripts - if [ ! -e ${LOCKDIR}/cron.$BASE ] ; then - touch ${LOCKDIR}/cron.$BASE - - set +e - for SCRIPT in $CRONDIR/* ; do - if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then - # Filter out files people do not expect to be executed. - case ${SCRIPT} in - .*|*~) continue ;; - esac - - [ -x /usr/bin/logger ] && /usr/bin/logger -i -p cron.info -t run-crons "(`whoami`) CMD ($SCRIPT)" - $SCRIPT - fi - done - fi -done - -# Clean out bogus cron.$BASE files with future times -touch ${LOCKDIR} -find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; &>/dev/null || true diff --git a/sys-process/cronbase/files/run-crons-0.3.5 b/sys-process/cronbase/files/run-crons-0.3.5 deleted file mode 100755 index 18a6199eb4b4..000000000000 --- a/sys-process/cronbase/files/run-crons-0.3.5 +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# this script looks into /etc/cron.[hourly|daily|weekly|monthly] -# for scripts to be executed. The info about last run is stored in -# /var/spool/cron/lastrun - -LOCKDIR=/var/spool/cron/lastrun -LOCKFILE=${LOCKDIR}/lock - -# Usage: log <level> <args to logger> -# Log a message via syslog. -log() { - local level=$1 - shift - logger -i -p "cron.${level}" -t run-crons "$@" -} - -mkdir -p ${LOCKDIR} - -# Make sure we're not running multiple instances at once. -# Try twice to lock, otherwise give up. -for ((i = 0; i < 2; i = i + 1)); do - ln -sn $$ ${LOCKFILE} 2>/dev/null && break - - # lock failed, check for a running process. - # handle both old- and new-style locking. - cronpid=$(readlink ${LOCKFILE} 2>/dev/null) || - cronpid=$(cat ${LOCKFILE} 2>/dev/null) || - continue # lockfile disappeared? try again - - # better than kill -0 because we can verify that it's really - # another run-crons process - if [[ $(</proc/${cronpid}/cmdline) == $(</proc/$$/cmdline) ]] 2>/dev/null; then - # whoa, another process is really running - exit 0 - else - rm -f ${LOCKFILE} - fi -done - -# Check to make sure locking was successful -if [[ ! -L ${LOCKFILE} ]]; then - echo "Can't create or read existing ${LOCKFILE}, giving up" - exit 1 -fi - -# Set a trap to remove the lockfile when we're finished -trap "rm -f ${LOCKFILE}" 0 1 2 3 15 - - -EXIT_STATUS=0 -for BASE in hourly daily weekly monthly ; do - CRONDIR=/etc/cron.${BASE} - - test -d $CRONDIR || continue - - if [ -e ${LOCKDIR}/cron.$BASE ] ; then - case $BASE in - hourly) - #>= 1 hour, 5 min -=> +65 min - TIME="-cmin +65" ;; - daily) - #>= 1 day, 5 min -=> +1445 min - TIME="-cmin +1445" ;; - weekly) - #>= 1 week, 5 min -=> +10085 min - TIME="-cmin +10085" ;; - monthly) - #>= 31 days, 5 min -=> +44645 min - TIME="-cmin +44645" ;; - esac - - find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; &>/dev/null || true - fi - - # if there is no touch file, make one then run the scripts - if [ ! -e ${LOCKDIR}/cron.$BASE ] ; then - touch ${LOCKDIR}/cron.$BASE - - set +e - for SCRIPT in $CRONDIR/* ; do - if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then - # Filter out files people do not expect to be executed. - case ${SCRIPT} in - .*|*~) continue ;; - esac - - log info "($(whoami)) CMD (${SCRIPT})" - $SCRIPT - ret=$? - if [ ${ret} -ne 0 ] ; then - log err "CMD (${SCRIPT}) failed with exit status ${ret}" - EXIT_STATUS=1 - fi - fi - done - fi -done - -# Clean out bogus cron.$BASE files with future times -touch ${LOCKDIR} -find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; &>/dev/null || true - -exit ${EXIT_STATUS} diff --git a/sys-process/cronbase/files/run-crons-0.3.6 b/sys-process/cronbase/files/run-crons-0.3.6 deleted file mode 100755 index d39777f1296d..000000000000 --- a/sys-process/cronbase/files/run-crons-0.3.6 +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# -# this script looks into /etc/cron.[hourly|daily|weekly|monthly] -# for scripts to be executed. The info about last run is stored in -# /var/spool/cron/lastrun - -LOCKDIR=/var/spool/cron/lastrun -LOCKFILE=${LOCKDIR}/lock - -# Usage: log <level> <args to logger> -# Log a message via syslog. -log() { - local level="$1" - shift - logger -i -p "cron.${level}" -t run-crons "$@" -} - -mkdir -p ${LOCKDIR} - -# Make sure we're not running multiple instances at once. -# Try twice to lock, otherwise give up. -i=0 -while [ $(( i += 1 )) -le 2 ] ; do - ln -sn $$ ${LOCKFILE} 2>/dev/null && break - - # lock failed, check for a running process. - # handle both old- and new-style locking. - cronpid=$(readlink ${LOCKFILE} 2>/dev/null) || - cronpid=$(cat ${LOCKFILE} 2>/dev/null) || - continue # lockfile disappeared? try again - - # better than kill -0 because we can verify that it's really - # another run-crons process - cmdline1=$(cat /proc/${cronpid}/cmdline 2>/dev/null) || : - cmdline2=$(cat /proc/$$/cmdline) - if [ "${cmdline1}" = "${cmdline2}" ] ; then - # whoa, another process is really running - exit 0 - else - rm -f ${LOCKFILE} - fi -done - -# Check to make sure locking was successful -if [ ! -L "${LOCKFILE}" ] ; then - echo "Can't create or read existing ${LOCKFILE}, giving up" - exit 1 -fi - -# Set a trap to remove the lockfile when we're finished -trap "rm -f ${LOCKFILE}" EXIT HUP INT QUIT TERM - - -EXIT_STATUS=0 -for BASE in hourly daily weekly monthly ; do - CRONDIR=/etc/cron.${BASE} - - test -d $CRONDIR || continue - - if [ -e ${LOCKDIR}/cron.$BASE ] ; then - case $BASE in - hourly) - #>= 1 hour, 5 min -=> +65 min - TIME="-cmin +65" ;; - daily) - #>= 1 day, 5 min -=> +1445 min - TIME="-cmin +1445" ;; - weekly) - #>= 1 week, 5 min -=> +10085 min - TIME="-cmin +10085" ;; - monthly) - #>= 31 days, 5 min -=> +44645 min - TIME="-cmin +44645" ;; - esac - - find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; 2>/dev/null || : - fi - - # if there is no touch file, make one then run the scripts - if [ ! -e ${LOCKDIR}/cron.$BASE ] ; then - touch ${LOCKDIR}/cron.$BASE - - set +e - for SCRIPT in $CRONDIR/* ; do - if [ -x "${SCRIPT}" ] && [ ! -d "${SCRIPT}" ] ; then - # Filter out files people do not expect to be executed. - case ${SCRIPT} in - .*|*~) continue ;; - esac - - log info "($(whoami)) CMD (${SCRIPT})" - $SCRIPT - ret=$? - if [ ${ret} -ne 0 ] ; then - log err "CMD (${SCRIPT}) failed with exit status ${ret}" - EXIT_STATUS=1 - fi - fi - done - fi -done - -# Clean out bogus cron.$BASE files with future times -touch ${LOCKDIR} -find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; 2>/dev/null || : - -exit ${EXIT_STATUS} |