Score:0

rsync: is there an option to make rsync stop at first error so i can see what's happening?

bq flag

CONTEXT : rsync with very large number of files to sync

WHAT HAPPENS : rsync encounters errors, but just continues.....

WHAT I DO : rsync -Pav path1 path2

ISSUE : I'm booted in a recovery mode and the recovery drive have no space left...

QUESTIONS : is there an option to make rsync stop at first error so I can see what's happening ?

I TRIED to look man page of rsync, but cannot find any option that would suggest stop at first error

Davidw avatar
in flag
Why not use the `-verbose` option?
bq flag
@Davidw I use `rsync -Pav` v for verbose. but the files goes too quickly and I have to ctrl+c to force it to stop to check what is the error
Michael Hampton avatar
cz flag
You could use `-q` or just redirect stderr somewhere so you can review all the errors at once when it finishes.
bq flag
@MichaelHampton is there any way to not wait until finish ? just simply stop at first error ? with verbose I see errors passing, and rsync continues... I just want rsync to stop or pause if it encounter any error
Michael Hampton avatar
cz flag
I could not find such a way. But I would be OK with letting it run all the way, if I can get all the errors at once (so I can hopefully resolve them all at once and not waste time re-running rsync each time).
in flag
Why waiting until it is finished? You can read the log file on another terminal while rsync is still running.
Michael Hampton avatar
cz flag
@GeraldSchneider That is true. You could start working on the first error even as more errors come in and the sync continues toward a mostly complete operation, saving even more time.
Score:2
iq flag

ISSUE : I'm booted in a recovery mode and the recovery drive have no space left...

QUESTIONS : is there an option to make rsync stop at first error so I can see what's happening ?

Unfortunately, it seems rsync does not support this at the moment. There is an issue about this on GitHub: #71 rsync does not terminate when target disk is full. There, Wayne Davison (rsync's maintainer) writes:

Since this problem is inherent in the way rsync works and there is a work-around fix, I'm closing this bug. A future rsync 4.0 will hopefully not have this issue.

The issue also lists using --msgs2stderr as a workaround, you could try that, it should at least make rsync exit more quickly.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.