|
|
#1 |
|
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()
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 Air Mid 2012 / iPhone 5. InfoSec guy. |
|
|
|
0
|
|
|
#2 |
|
Problems solved. I just needed timeout=None.
Code:
child = pexpect.spawn('scp %s/%s USER@IPADDRESS:/folder/path/%s' % (bkpdir, file, date), timeout=None)
__________________
MacBook Air Mid 2012 / iPhone 5. InfoSec guy. |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 12:06 AM.






Linear Mode
