1

I have remote stations that collect data from sensors (ARM Debian) and transfers sets of data (about 1.1 MB) every 15 minutes (server is full Debian). On one station GSM reception is poor and standard scp transfers are often broken and have to be started from beginning.

Now I'm trying rsync. On station I invoked:

rsync --partial --remove-source-files --progress --rsh=ssh -z FILE root@SERVER:/DIR/

After several minutes file appeared on server. (is it possible to see current transfer status on receiving server - file appeared when transfer was completed?)

How to resume transfer when it's broken? If file is not deleted transfer was not completed?

2
  • 1
    Unfortunately my broken transfers are started all over again. How to resume? Jul 31, 2013 at 22:33
  • 1
    --append helped. Aug 1, 2013 at 13:16

1 Answer 1

1

Rsync exits with a non-zero exit code if the transfer doesn't complete. If you're using bash or a similar shell, a simple solution would be to run it like this:

until rsync --partial --etc
do
    sleep 1
    echo trying again
done

This will keep rerunning rsync indefinitely until it succeeds. The commands inside the do...done block are just an example. You could put something else there.

1
  • I would not recommend this. It could easily get stuck in an infinite loop (what happens if the network goes down? Or if you run out of disk space?)
    – num1
    Oct 10, 2013 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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