Crontab et encodage python
bonjour
J'ai un problème de cron qui ne passe pas la commande . Postfix envoi la différence sur pc1 et pc2 .
Comment sous python faire une maj pour obtenir le même postfix et débloquer ce cron ( pc1 ) ?
Cron pc1 ( bloqué ) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| From pi@raspberrypi Mon Apr 28 16:34:03 2014
Return-Path: <pi@raspberrypi>
X-Original-To: pi
Delivered-To: pi@raspberrypi
Received: by raspberrypi (Postfix, from userid 1000)
id D845321415; Mon, 28 Apr 2014 16:34:02 +0200 (CEST)
From: root@raspberrypi (Cron Daemon)
To: pi@raspberrypi
Subject: Cron <pi@raspberrypi> python /home/pi/ftp_1.py
Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/pi>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=pi>
Message-Id: <20140428143402.D845321415@raspberrypi>
Date: Mon, 28 Apr 2014 16:34:02 +0200 (CEST)
Traceback (most recent call last):
File "/home/pi/ftp_1.py", line 34, in <module>
print(go_ftp())
File "/home/pi/ftp_1.py", line 27, in go_ftp
file = open(fichier, 'rb') # ici, j'ouvre le fichier
IOError: [Errno 2] No such file or directory: 't25_04.csv' |
Cron pc2 :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| From ubuntu@ubuntu-A7N8X2-0 Mon Apr 28 16:12:02 2014
Return-Path: <ubuntu@ubuntu-A7N8X2-0>
X-Original-To: ubuntu
Delivered-To: ubuntu@ubuntu-A7N8X2-0
Received: by ubuntu-A7N8X2-0 (Postfix, from userid 1000)
id 62ACB5FDE; Mon, 28 Apr 2014 16:12:02 +0200 (CEST)
From: root@ubuntu-A7N8X2-0 (Cron Daemon)
To: ubuntu@ubuntu-A7N8X2-0
Subject: Cron <ubuntu@ubuntu-A7N8X2-0> python /home/ubuntu/ftp_1.py
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/ubuntu>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=ubuntu>
Message-Id: <20140428141202.62ACB5FDE@ubuntu-A7N8X2-0>
Date: Mon, 28 Apr 2014 16:12:02 +0200 (CEST)
Transfert fichier ...
Terminé
None |
:mrgreen: