I got a script which runs in a cronjob as root. The problem is that the addgroup command would output "Command not found" when it gets executed by the script.
#!/usr/bin/perl
$datei = `ls /var/www/cron/`;
@datei = split(/\n/, $datei);
foreach ( @datei ) {
$datei = $_;
open(bfh,"</var/www/cron/$datei") or die $!;
while ( <bfh> ) {
chomp($_);
print "$_\n";
system("$_\n");
}
#unlink("/var/www/cron/$datei") or die $!;
}
Crontab
* * * * * /usr/bin/perl /home/hermes/cron.pl >> /home/hermes/cronlog
2>> /home/hermes/cronerr