Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th September 2009, 02:38
gmack gmack is offline
Junior Member
 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 by gmack; 29th September 2009 at 02:53.
Reply With Quote
Sponsored Links
  #2  
Old 29th September 2009, 14:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

The first line must be
Code:
#!/bin/bash
not
Code:
#/etc/cron.daily/awstats_pages
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 30th September 2009, 05:50
gmack gmack is offline
Junior Member
 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I made that change, had no effect unfortunately... any other thoughts?
Reply With Quote
  #4  
Old 1st October 2009, 16:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
 
Default

What does the script look like now?
Did you save it with Unix linebreaks?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need shell script for extracting website content for a list of given websites unknowngeek Programming/Scripts 3 14th October 2009 18:44
Executing all shell scripts in specified directory Leszek Programming/Scripts 7 28th September 2009 15:41
Fedora Core 5 ISP, Major Problems jnolla HOWTO-Related Questions 33 6th June 2007 15:01
Totally Confused?? :( kingtux Installation/Configuration 7 9th February 2006 22:14
suse 9.3 install: E: Couldn't find package ncftp aallen Installation/Configuration 4 26th January 2006 20:02


All times are GMT +2. The time now is 15:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.