PDA

View Full Version : python script help



saracen
October 8th, 2006, 12:19 PM
I made a simply python script that downloads a bunch of pdf's from a news website and then executes a local command to join them into one single pdf file. Now I need the script to upload that generated file automatically to a remote server, but that requires a password. Is there any way I can make that part automated without having to manually input a password each time? And if so, how do I make a cron job that will run the script daily?

dabear
October 8th, 2006, 02:01 PM
What kind of method do you use for uploading? FTP?

http://66.102.9.104/search?q=cache:cJP-YMo-eFgJ:www.bigbold.com/snippets/posts/show/711+python+ftp&hl=no&gl=no&ct=clnk&cd=3&client=firefox-a

http://docs.python.org/lib/module-ftplib.html

saracen
October 9th, 2006, 08:48 PM
I'm uploading it using scp. I created a bash script that runs the python script and then when it's done it calls scp to upload the generated pdf. That part requires a password.

dabear
October 9th, 2006, 11:37 PM
I'm uploading it using scp. I created a bash script that runs the python script and then when it's done it calls scp to upload the generated pdf. That part requires a password.

Do it from python instead using pxpect

http://www.palovick.com/code/python/python-ssh-client.php

saracen
October 10th, 2006, 03:09 AM
Cool, thanks. How do I make a cronjob that automatically calls my script once a day?