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

Similar Threads
thread Thread Starter Forum Replies Last Post
Connection timeout ecvaughn MacBook Pro 1 Jun 13, 2013 05:39 PM
Connection timeout on wifi Maggot FF Mac Peripherals 0 Jan 29, 2013 08:46 PM
CD Timeout kelvinmead MacBook Pro 4 Jan 11, 2013 12:47 PM
Connection Timeout? maccingout MacBook Pro 0 Sep 21, 2012 02:19 PM
WiFi Timeout in ML this is funah OS X 10.8 Mountain Lion 1 Jul 13, 2012 12:50 PM

Forum Jump

All times are GMT -5. The time now is 10:44 PM.

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

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