Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Unfortunately my broken transfers are started all over again. How to resume? –  Marcin Polkowski Jul 31 '13 at 22:33
    
--append helped. –  Marcin Polkowski Aug 1 '13 at 13:16
add comment

1 Answer

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.

share|improve this answer
    
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 '13 at 19:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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