[RESOLU]probleme d'utilisation de cron

Post new topic   Reply to topic    DD-WRT Forum Index -> Questions générales
Author Message
Miranthil
DD-WRT Novice


Joined: 28 Oct 2010
Posts: 5

PostPosted: Thu Nov 25, 2010 15:49    Post subject: [RESOLU]probleme d'utilisation de cron Reply with quote
Bonjour,

J'ai créé un script qui rapatri un config d'un serveur distant.
manuellement, le script s'execute correctement.
Maintenant, je veux planifier l'execution de ce script mais ca ne fonctionne pas.
Dans l'interface graphique, dans jobs additionnels, j'ai ecrit la ligne suivante:

Code:
0 1 * * * * 1-7 root sh /jffs/import_config>>/jffs/result

il crée bien le fichier result mais il n'y a rien dedans et mon fichier de conf n'est pas rapatrié.

je suis sur DD-WRT V24-sp2

Merci d'avance pour l'info


Last edited by Miranthil on Tue Nov 30, 2010 10:46; edited 1 time in total
Sponsor
yzy-oui-fi
DD-WRT Guru


Joined: 03 Mar 2009
Posts: 2826
Location: France

PostPosted: Mon Nov 29, 2010 7:07    Post subject: Reply with quote
si le fichier est créé, cron n'y est pour rien si il est vide(tu as demandé a cron d'exécuter un script, il l'a fait), regardes plutot ton script si il n'y a pas un bug ou une erreur de syntaxe.
_________________
DD-WRT WDS MESH + DASHBOARD (fr), DD-WRT network setting tool (tools.yzy-oui-fi.com), Wifi Business and IT guy After hours, My Blog, Free DD-WRT VPN Community(www.wrt-pptp-ww.com), DD-WRT pré-réglés pour réseau outdoor(hotspot.yzy-oui-fi.com), Nouveau Forum DD-WRT francophone
Miranthil
DD-WRT Novice


Joined: 28 Oct 2010
Posts: 5

PostPosted: Mon Nov 29, 2010 15:48    Post subject: Reply with quote
Je n'ai pas de souci avec mon script, parce que quand je tapes:

Code:
sh /jffs/import_config


Il execute bien le code et me rapatrie bien la config

et si je remplace m'a ligne dans le cron :

Code:
0 1 * * * * 1-7 root sh /jffs/import_config>>/jffs/result


par
Code:
0 1 * * * * 1-7 root echo test>>/jffs/result


Il devrait dans le fichier
Quote:
/jffs/result
écrire
Quote:
test
mais le fichier est vide.
Miranthil
DD-WRT Novice


Joined: 28 Oct 2010
Posts: 5

PostPosted: Tue Nov 30, 2010 10:45    Post subject: Reply with quote
Je me repond à moi meme,

J'ai trouvé:

La bonne ligne à taper,c'est pour une execution a 8H00:
Code:
00 08 * * * * * /bin/sh /jffs/import_config>>/jffs/result

il faut précisé ou se trouve "sh" et ensuite il faut donner les droits d'execution au script avec "chmod"

J'espere que j'aurais aidé d'autre personne avec mon probleme.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Questions générales All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum