upload-safely ( local username host remote -- )


Vocabulary
mason.common

Inputs
localan object
usernamean object
hostan object
remotean object


Outputs
None

Definition


:: upload-safely ( local username host remote -- )
remote ".incomplete" append :> temp
{ username "@" host ":" temp } concat :> scp-remote
scp-command get :> scp ssh-command get :> ssh 5
[ { scp local scp-remote } upload-process ] retry 5 [
{ ssh host "-l" username "mv" temp remote }
short-running-process
] retry ;