I am looking to write a script that will group up some files on a remote server for me that way I can download the ones I need with a single "scp" command. I am wondering if there is a way I can have my script pause while I scp my files. What I have so far is working. It would just be more convenient to break this down to one script and one command. 

\*\*script on remote server:

```
    for root, dirs, files in os.walk('.'):
        for f in files:
              if ('csv') in file.split('.'):
                     cp_str = ''.join(['cp ', file, ' ~/move_files/.'])
                     subprocess.check_output(cp_str, shell=True)

```

\*\*Then in terminal on my local computer I scp all the files in 'move\_files' from my remote server 

\*\*Then I go back to the remote server via ssh and empty out that directory

To clarify I want to add something to the script that will make it wait after it has copied the files, giving me a signal that it has copied them. Then I can scp and resume my script which will go back and delete the files it copied earlier .