Restartable RSYNC and CP – Loops until completion

Version 1 of this can be found here: version1 (note version2 isnt necessarily better, its just shorter)

This is another version of a restartable RSYNC and CP script. This variation is in one line. You can edit the commands to meet your needs.

The commands loop by looking at the exit code of cp or rsync. If one of those exit(or crash) with an exit code other then 0 (0 meaning successful run), then the script will repeat the cp or rsync command.

RSYNC VARIATION

You can test the command before running the big loop like so:
If the above loop script (not the test command) is confusing and you want to see it with newline characters for prettier more human readable output here it is:

 CP VARIATION

You can test cp like this before running the above command:
If the above loop script (not the test command) is confusing and you want to see it with newline characters for prettier more human readable output here it is:

Leave a Reply

Your email address will not be published. Required fields are marked *