Page 1 of 1

Iam prob

Posted: 2003-02-04 15:21
by kworth2
p15107591:/usr/local/iam # /usr/local/iam/iam_report
/usr/local/iam/iam_report: month+%Y-%m: command not found
/usr/local/iam/iam: illegal to-date: -23
diesen fehler bekomm ich immer bei iptables, hab iptables wie im tutorial installiert, und die reports werden natürlich nur mit 0mb angezeigt hier die file:

Code: Select all


#!/bin/sh

IAM=/usr/local/iam/iam
DUMP=/usr/local/iam/dump
WWWDIR=/home/www/web1/html/reports

YM_CURRENT=`date '+%Y-%m'`
YM_LAST=`date --date='1 month ago' '+%Y-%m'`
YM_NEXT=`date --date=`1 month` `+%Y-%m``

$IAM -f $YM_CURRENT-23 -t $YM_NEXT-23 -w $WWWDIR/$YM_CURRENT.html $DUMP
$IAM -f $YM_LAST-23 -t $YM_CURRENT-23 -w $WWWDIR/$YM_LAST.html $DUMP

ln -sf $WWWDIR/$YM_CURRENT.html $WWWDIR/current.html
ln -sf $WWWDIR/$YM_LAST.html $WWWDIR/last.html

exit $?


Re: Iam prob

Posted: 2003-02-04 15:27
by captaincrunch
Ã?nder mal die Zeile

YM_NEXT=`date --date=`1 month` `+%Y-%m``

in

YM_NEXT=`date --date='1 month' '+%Y-%m'`

Du benutzt Backticks da, wo sie eigentlich nicht hingehören ... :wink: