Hallo habe folgendes Skript:
Wenn ich es von "Hand" starte funktioniert es problemlos.
Wenn ich es als Cronjob laufen lasse:
erhalte ich folgende Fehler:
cp: missing destination file
Try `cp --help' for more information.
rm: too few arguments
Try `rm --help' for more information.
chmod: cannot access `dilbert_20050203.gif': No such file or directory
Woran liegt dies, danke für eure Hilfe.
Gruß Markus
Code:
#!/bin/bash
picpath=/data/intranet/dilberts
path=`curl -s "http://www.dilbert.com/" | tr [:blank:],'<','=','"' '\012' | grep "/comics/dilbert/archive/images/dilbert" | tail -n1`
file=` echo $path | tr '/' '\012' | grep ".gif" `
url=http://www.dilbert.com${path}
curl -s ${url} -o ${picpath}/${file}
filename=`date "+dilbert_%Y%m%d.gif"`
cd $picpath
rm today.gif
cp ${file} ${filename}
rm ${file}
/bin/ln -s ${filename} today.gif
chmod 644 ${filename}
Wenn ich es als Cronjob laufen lasse:
Code:
0 12 * * * /data/intranet/dilbert.sh
cp: missing destination file
Try `cp --help' for more information.
rm: too few arguments
Try `rm --help' for more information.
chmod: cannot access `dilbert_20050203.gif': No such file or directory
Woran liegt dies, danke für eure Hilfe.
Gruß Markus