I need to move a large number of files that need to go to different directories i.e.

file1.mpg to /mnt/s3/directory1/file1.mpg
file2.mpg to /mnt/s3/directorya/file2.mpg
file3.mpg to /mnt/s3/directoryx/anotherfilename.mpg

rsync -av --progress --inplace /path/to/file1.mpg /different/path/directory/1/file1.mpg

Works but I would like to batch all the file transfers together so I don't have to monitor it all the time and keep manually put in each rsync. I wrote a quick shell script to rsync the files but after the file is transferred it seems to hang there waiting for some sort of user input. If ^c it continues on, otherwise will hang there indefinitely.

  • 1
    AFAIK there is no feasible way to accomplish what you want. Why don't you post your shell script, there are plenty of people here who can find the problem.
    – Graeme
    Feb 24 '14 at 18:10
  • Do you want to move or copy ?
    – X Tian
    Feb 24 '14 at 19:42
  • I have never used the --inplace switch but seems like it updates and existing file on the destination. And if your destination is, somehow forcing a confirmation, i.e. hit 'y' or 'n', that might explain why it is hanging. Try making the destination file names such that they will not exists in ther detination location and see if your script will proceed w/o needing a ctrl-c etc. Just a troubleshooting suggestion, not intended to be a solution.
    – MelBurslan
    Feb 24 '14 at 21:23
  • 2
    I don't understand the question. What's wrong with mv file1.mpg /mnt/s3/directory1/; mv file2.mpg /mnt/s3/directorya/; …? Feb 24 '14 at 23:46
set -e
R="rsync -a --timeout=10"
$R file1.mpg /mnt/s3/directory1/
$R file2.mpg /mnt/s3/directorya/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.