Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl
request-tracker
suse.de-request-tracker.cron.hourly
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File suse.de-request-tracker.cron.hourly of Package request-tracker
#!/bin/bash # # $Id$ # PATH=/bin:/usr/bin DISTCONFIG="/etc/sysconfig/request-tracker" ################################################## # Default/Fallback values # Don't change them here! Use $DISCONFIG instead ################################################## DEBUG='no' EMAIL='root@localhost' HOST=$(hostname -s 2>/dev/null) LOGFILE='__RT_LOGDIR__/cronjobs-request-tracker.log' LOGNAME='dashboards' MAILX='/usr/bin/mail' ################################################## umask 027 unset LANG; function cleanup_and_exit(){ local exitcode="$1" exit $exitcode } function LOG(){ local MESSAGE="$1" local LOG_DATE=$(date "+%b %d %H:%M:%S") if [ -z "$LOGFILE" ]; then echo "ERROR: LOGFILE is not defined" | $MAILX -s "[$LOGNAME] error on $FQHOSTNAME" $EMAIL cleanup_and_exit 1 fi if [ ! -d "$LOGDIR" ]; then mkdir -p "$LOGDIR" || exit 1 echo "$LOG_DATE $HOST $LOGNAME[$$]: function LOG created $LOGDIR" > "$LOGFILE" fi echo "$LOG_DATE $HOST $LOGNAME[$$]: $MESSAGE" >> $LOGFILE || DEBUG="yes" if [ "$DEBUG" = "yes" ]; then echo "DEBUG: $MESSAGE" fi } function print_help(){ echo "Usage: $(basename $0) [-c <configfile>]" echo echo " -d : turn debug output on" echo " -f : force execution" echo " -h : print this message" echo " -c <configfile> : use the given config file instead of $DISTCONFIG" echo exit 0 } trap cleanup_and_exit 0 1 2 3 7 13 15 while getopts 'fhc:d' OPTION ; do case $OPTION in h) print_help ;; c) DISTCONFIG="$OPTARG" ;; d) DEBUG='yes' ;; f) RUN_DASHBOARDS_HOURLY='yes' ;; esac done shift $(( OPTIND - 1 )) # source our config if [ -f "$DISTCONFIG" ]; then . "$DISTCONFIG" LOGDIR=$(dirname "$LOGFILE") else echo "$DISTCONFIG not found - using defaults" >&2 LOGDIR=$(dirname "$LOGFILE") LOG "$DISTCONFIG not found - using defaults" fi case "$RUN_DASHBOARDS_HOURLY" in [Yy][Ee][Ss]) if [ "$DEBUG" == "yes" ]; then LOG "Running hourly dashboard update" fi __RT_SBINDIR__/rt-email-dashboards ;; esac
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor