I am regularly copying big files over the internet via
rsync, and since I am travelling a lot, I don't generally have access to stable internet connection, so I end-up rerunning the command multiple times until it succeeds.
Turns out there is a better way. Of course you could use
while and test the return of the command, but that sounds like a lot of work for a ad hoc command. But I am lazy and I recently discovered that an
until command exists!
Pretty straightforward to use:
$ until <put your command here>; do echo "Retrying at `date -Iminutes`"; done
rsync you get:
$ until rsync -aP src:/path/to/src dest/; do echo "Retrying at `date -Iminutes`"; done
And if you are really lazy, just create an alias (left as an exercise ;) ).
This post was originally published on mayeu.me.
Need to keep up with a fast-moving software industry?
In this course, we will create a Vue blog CMS, step-by-step, and we will cover major aspects of executing GraphQL queries, mutations and subscriptions.We will learn how to setup and deploy Hasura for free on Heroku. We will see how Hasura provides a realtime GraphQL API on top of a new (or existing) Postgres database that we will use to build our Vue app.