Bonjour,
Malgre le parcours d'un certain nombre de forum je n'arrive pas a faire fonctionner mon script ci dessous qui fonctionne en ligne de commande :
En fait, j'essaie d'imprimer un fichier xls depuis crontab
Cela marche donc avec :
PrintXls2ps.sh
J'ai l'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 #!/bin/sh /usr/lib/openoffice/program/soffice -p PSPRINTER /home/ftp/export/Excel/simple.xls Si je fais crontab -e (comme root) SHELL=/bin/sh PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin 30 * * * * /usr/bin/PrintXls2ps.sh >>/home/frp/export/Excel/FileLog.txt 2>&1
J'ai essaye avec/usr/lib/openoffice.org/program/soffice.bin X11 error: Can't open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)
Et rien ne marche
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 1- 30 * * * * /bin/sh /usr/bin/PrintXls2ps.sh >>/home/frp/export/Excel/FileLog.txt 2>&1 2- /usr/lib/openoffice/program/soffice -headless -p PSPRINTER /home/ftp/export/Excel/simple.xls 3- using source /home/"username"/.bash_profile dans le sh script 4- export DISPLAY:=0:0 dans le sh script 5- 30 * * * * root /bin/sh /usr/bin/PrintXls2ps.sh >>/home/frp/export/Excel/FileLog.txt 2>&1 6- 30 * * * * export DISPLAY=:0 /bin/sh /usr/bin/PrintXls2ps.sh >>/home/frp/export/Excel/FileLog.txt 2>&1
Quelqu'un a une piste ?
J'utilise etch with ooo 2.0.3
Merci par avance
Partager