0

I am trying to copy a directory from a local to remote system using Fabric in Python. The directory is rather large ~150MB and I am using put() function to copy the folder. The problem I see is that most of the times, the command gets stuck and never moves forward. The log file says:

INFO:paramiko.transport.sftp:[chan 2] Opened sftp connection (server version 3)

and remains there forever. Is there any other function/mechanism which can display me the status of copying or let me know what is happening while copying? I looked at rsync_project and upload_project but they don't seem to show the status of copy. Please let me know if I can do this in some better way.

I also looked at this solution wherein they added a progress bar to put(), but since they use a 3rd party package 'progressbar', I will prefer an alternate solution: https://github.com/fabric/fabric/issues/394

ic10503
  • 131
  • 4
  • 16
  • you could just put `print` instead of `progressbar` in the callback. `put` returns an iterable filenames that are already uploaded you could check `.failed` attribute. You could use `rsync_project("remote_dir", "local_dir")` or `upload_project("local_dir", "remote_dir")` to upload local_dir into remote_dir – jfs May 16 '13 at 09:30
  • But put by default does not accept any parameter called callback. Also, do rsync_project and upload_project show the progress/status of copy/upload (I didn't see any) ? – ic10503 May 16 '13 at 19:13
  • yes, to add callback you need to patch fabric using the code from the issue you've linked, the point is it doesn't depend on `progressbar` package. I've mentioned `*_project()` functions in a *comment* instead of an *answer* to show alternative ways to sync a directory (they do not report progress, otherwise it would be an answer) – jfs May 17 '13 at 02:44
  • @kumar can you show us what was the outcome? – РАВИ Feb 25 '16 at 09:27

0 Answers0