The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-20-2005
xaphalanx xaphalanx is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 3
Simple Bash Script

I'm sure I'm doing something wrong but as I am new to bash shell scripting I'm not sure what:

Here's the code

Quote:
#!/bin/bash

FILEDATE=`date -d yesterday '+%Y%m%d'`
YEARDATE=`date -d yesterday '+%Y'`
LOGFILE="/logs/sitename/$YEARDATE/access$FILEDATE.log"
webalizer -c webalizer.conf $LOGFILE
webalizer.conf is sitting in the same directory as this file which is named webalizer.sh. Can someone tell me if I've got the syntax right -- it that's correct? I'm executing the file as root with sh ./webalizer.sh. webalizer -c file file executes correctly when I manually insert the variable values. The goal is to get this to run through cron.

Thanks!