tonybaldwin
tonybaldwin

Reputation: 171

Is there a simple way to use scp that will behave like rsync -u or cp -u

I'd like to be able to upload to my remote server only updating new files. I am using a nanoblogger, and it appears to upload the entire thing every time using plain scp -r, but I can't find any -u option for scp mentioned in the man pages.

I suppose I could try to somehow script the upload with an ls or find that grabs only files updated in the last $n minutes, or something, but that seems heavy handed.

Upvotes: 0

Views: 1013

Answers (2)

thiton
thiton

Reputation: 36049

scp doesn't have any conditional option, and probably won't get it anytime soon. rsync seems like a very reasonable way, if it is installed on the target system; if not, some find + uniq magic could do the job, but would be serious work. Compiling rsync would probably be faster :-).

Upvotes: 0

Arnaud Le Blanc
Arnaud Le Blanc

Reputation: 99921

Use rsync over SSH.

I you can scp, you can very probably rsync over ssh:

rsync -a /some/dir/ user@server:/dest/dir/

Upvotes: 5

Related Questions