fcrontab and script command nonexecution

freebsd at critesclan.com freebsd at critesclan.com
Tue Aug 12 20:44:51 PDT 2003


Evan;

I don't use "script" very often because it requires you be running in from a
terminal. I have a lot of cron based scripts which I want to keep the output
from, so I "rolled my own." Here is a VERY SMALL example, with NO ERROR
CHECKING. But it shows you how you can do what you are wanting to do. Save
this someplace, make it executable (of course) and stick it into your
crontab in place of "script."

Lee



#!/bin/sh
SFILE=$1 ; shift
SCMD="$1" ; shift
SREST="$*"
(
echo "Starting $SCMD at `date '+%d-%h-%Y %H:%M:%S'`"
$SCMD $SREST 2>&1
echo "Ending $SCMD at `date '+%d-%h-%Y %H:%M:%S'`"
) 1>$SFILE 2>&1



More information about the freebsd-ports mailing list