Guest User

Untitled

a guest
Aug 17th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import ssh
  2.  
  3. def normalize(lst):
  4.     return map(lambda x: x.rstrip('\n')[2:], lst)
  5.    
  6. s = ssh.Connection(host = '192.168.1.101', username = 'root', password = '****')
  7.  
  8. lista = s.execute("cd /private/var/mobile/Media/DCIM/100APPLE/; find . -type f -mtime -4 -exec ls {} \;")
  9. lista = normalize(lista)
  10.  
  11. for cur_file in lista:
  12.     src = "/private/var/mobile/Media/DCIM/100APPLE/%s" % (cur_file)
  13.     dest = "/home/giovanni/public/%s" % (cur_file)
  14.     s.get(src, dest)
  15.  
  16. s.close()
Add Comment
Please, Sign In to add comment