Executing a list of shell scripts via cron.daily?

Discussion in 'Programming/Scripts' started by gmack, Sep 29, 2009.

  1. gmack

    gmack New Member

    Executing a list of shell commands via cron.daily?

    Hi everyone, I am relatively new to server admin tasks and completely self taught. (which is always an issue.)

    I am having a small problem with my domain logs/stats software. I am using a relatively well known script called 'Awstats' which does it's job quite well.

    I have a crontab task running; to collect all the data from the apache log file and sort it into awstat's data file which is working perfectly.

    The problem I have is that the cron.daily file/job I have created to regenerate the .html pages fails. However, if I run the commands independently through a shell, everything runs properly.

    I have created a file (viewable below) that contains a shell command for each domain, that is located inside the cron.daily folder. If someone could please explain to me why this is not working or even show me how I can resolve the issue, I would be very appreciative.

    Code:
    #/etc/cron.daily/awstats_pages
    #!/bin/bash
    /var/www/awstats/tools/awstats_buildstaticpages.pl -update -config=xx.com -dir=/home/xx.com/stats done;
    I apologise if this is a stupid question but I have spent hours trying to resolve it myself to no avail.

    Thanks, Gordon MacK
     
    Last edited: Sep 29, 2009
  2. falko

    falko Super Moderator Howtoforge Staff

    The first line must be
    Code:
    #!/bin/bash
    not
    Code:
    #/etc/cron.daily/awstats_pages
     
  3. gmack

    gmack New Member

    I made that change, had no effect unfortunately... any other thoughts?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    What does the script look like now?
    Did you save it with Unix linebreaks?
     

Share This Page