Salut à tous,
j'ai un script qui s'exécute très bien quand je le lance en ligne de commande en revanche il ne fonctionne pas quand je lance via CRONTAB.
Voici le script :
#Je récupère mon IP wan que je met dans un fichier
wget --output-document=/cb/ipsyno.txt http://www.showmyip.com/simple/
#Je dépose cette adresse wan sur mon site en FTP (journalisation dans log.txt)
wput /cb/ipsyno.txt ftp://login:pwd@ftp.monsite/www/cb/ipsyno.txt > /cb/log.txt
#Journalisation de l'IP dans spy.log
dte=`date +%d/%m/%Y`
hrs=`date +%H:%M:%S`
ip=$(cat /cb/ipsyno.txt)
echo "$ip le $dte a $hrs" >> /cb/spy.log
#mails_cb est une copie du fichier "tag_event" avec un tag perso ou j'y ajoute mon IP wan
cp mails_cb mails_tmp
#ajout de l'IP wan dans mails_tmp
cat ipsyno.txt >> mails_tmp
#remplacement de mails par mails_tmp qui a la nouvelle adresse IP
cp mails_tmp /usr/syno/synoman/webman/texts/fre/mails
#suppression du fichier temporaire
rm mails_tmp
#Appel de synomail avec mon evenement
synomail ipsyno
Seulement quand cron lance le script, le fichier ipsyno.txt est bien mis à jours et après STOP
A la main avec la commande sh monscript.sh ça fonctionne bien.
Vous avez une idée ??
Merci d'avance
LeBuss