fix cron template

tags/0.1.0
Daniel Berteaud 13 years ago
parent 724e8bdf61
commit ec9b19134f
  1. 2
      ipasserelle-stats.spec
  2. 8
      root/etc/e-smith/templates/etc/cron.hourly/awstats/10All

@ -1,5 +1,5 @@
%define version 0.0.1
%define release 1.beta3
%define release 1.beta6
%define name ipasserelle-stats

@ -1,14 +1,14 @@
{
use esmith::DomainsDB;
my $d = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n";
my $year = `date +%Y`;
my $lang = $awstats{'Language'} || 'fr';
$OUT .= 'YEAR=$(date +%Y)'."\n";
foreach my $dom ($d->domains){
my $stats = $dom->prop('Stats') || 'disabled';
next if ($stats ne 'enabled');
my $name = $dom->key;
my $lang = $awstats{'Language'} || 'fr';
mkdir "/home/e-smith/files/stats/$name/$year/" if (!-d "/home/e-smith/files/stats/$name/$year/");
$OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/$year/\n";
$OUT .= 'mkdir -p /home/e-smith/files/stats/'."$name".'/$YEAR/'."\n";
$OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/\$YEAR/\n\n";
}
}

Loading…
Cancel
Save