Skip to content

@polettix /silv-crontab.sh
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple crontab shell driver
#!/bin/bash
function die () {
echo "$*" >&2
exit 1
}
basedir=$(dirname "$0")
basedir=$(readlink -f "$basedir")
cd "$basedir" || die "cannot hop into $basedir"
unset MODULEBUILDRC
unset PERL_MM_OPT
unset PERL5LIB
export PATH='/home/whatever/silv/perl-5.14.2/bin:/home/whatever/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin'
date=$(date '+%Y-%m-%d')
logfile="log/SILV-$date.log"
/home/whatever/silv/perl-5.14.2/bin/perl -I lib bin/silv -c etc/field.conf >"$logfile" 2>&1
# cleanup older runs
find "log" -type f -name 'SILV-*.log' -not -newermt '-60 days' -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.