Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

msjones

macrumors 6502
Original poster
Oct 18, 2007
429
4
Nottinghamshire, UK
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
 

msjones

macrumors 6502
Original poster
Oct 18, 2007
429
4
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.