What's wrong with the following script

# Log directory and file
LOGDIR=.
LOGFILE=$LOGDIR/wgetlog-`date +%m-%d-%y-%H:%M`.log
......


$WGET --user-agent="Mozilla/5.0" --secure-protocol=auto --post-data $AUTH_DATA --save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL -O sso.out >> $LOGFILE 2>&1
........

$WGET  --user-agent="Mozilla/5.0"  --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://updates.oracle.com/Orion/Services/download/p10404530_112030_Linux-x86-64_6of7.zip?aru=14125322&patch_file=p10404530_112030_Linux-x86-64_6of7.zip" -O $OUTPUT_DIR/p10404530_112030_Linux-x86-64_6of7.zip   >> $LOGFILE 2>&1


errors are as follow

/media/104F-17FB/it_vendor/oracle/rdbms/oracle11g/linux_x86-64/oracle_11.2.0.3/wget.sh: line 52: ./wgetlog-04-26-13-07:06.log: Invalid argument
/media/104F-17FB/it_vendor/oracle/rdbms/oracle11g/linux_x86-64/oracle_11.2.0.3/wget.sh: line 66: ./wgetlog-04-26-13-07:06.log: Invalid argument

May I know what's wrong?

thanks a lot!

I'm guessing here, but try changing:

LOGDIR=.

to:

LOGDIR=$PWD

Plus, wget has it's own built in logging options?
From: man wget

       Logging and Input File Options

       -o logfile
       --output-file=logfile
           Log all messages to logfile.  The messages are normally reported to standard error.

       -a logfile
       --append-output=logfile
           Append to logfile.  This is the same as -o, only it appends to logfile instead of overwriting the old log file.  If
           logfile does not exist, a new file is created.
...
1 Like