Sunday, May 9, 2010

Resume support for SSH/SCP downloads in *nix

I've had problems with broken downloads on a Solaris 10 system, and after some digging I found that rsync has a native "partial completion" component built in that keeps partially downloaded files and then continues where you left off on restarting the download (rsync man page). The Machine you are downloading FROM needs to have rsyncd enabled though.

First create an alias to simplify things:

alias scpr='rsync -avzh --progress --partial --stats --itemize-changes -e ssh '

Then start your download:

scpr user@host:/dir/file .

If the download breaks, just re-run the command and it will continue from where it left off.

No comments:

Post a Comment