Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 11, 2013, 09:14 AM   #1
msjones
macrumors 6502
 
Join Date: Oct 2007
Location: Nottinghamshire, UK
Python pexpect timeout issues

Hi,

Hoping someone here can give me some advice with a script I'm working on. To start with here is the function I am having a problem with:

Code:
for file in os.listdir(bkpdir):
        child = pexpect.spawn('scp %s/%s USER@IPADDRESS:/folder/path/%s' % (bkpdir, file, date))
        child.expect("password: ")
        child.sendline("password")
        data = child.read()
        child.close()
As you can see from the above code snippet I am trying to scp all the files (one by one) in a backup dir to another location on the local LAN.

My issues begins when the script reaches a file > 100MB. Pexpect seems to be timing out before the file has successfully copied. Some files that will be going over are > 1.5GB, so if possible I would like to find a resolution to this issue.

Thanks
__________________
MacBook Pro / Nexus 4.
InfoSec guy.
msjones is offline   0 Reply With Quote
Old Jan 11, 2013, 09:43 AM   #2
msjones
Thread Starter
macrumors 6502
 
Join Date: Oct 2007
Location: Nottinghamshire, UK
Problems solved. I just needed timeout=None.

Code:
child = pexpect.spawn('scp %s/%s USER@IPADDRESS:/folder/path/%s' % (bkpdir, file, date), timeout=None)
Sorry for the wasted post, please close.
__________________
MacBook Pro / Nexus 4.
InfoSec guy.
msjones is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:26 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC