Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to simulate what cp --backup=numbered does using scp or another network copy command.

Any suggestion?

share|improve this question

migrated from Oct 13 '12 at 1:30

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

rsync has a -b flag which appears to do what you want, and has a -e ssh flag to enable encryption. This may be as close as you get.

share|improve this answer
Another possibility might be to install remotely a version system (perhaps git or svn) and access it thru ssh – Basile Starynkevitch Oct 12 '12 at 18:35
Close enough but I don't get versioned backup copies of the destination file. I should have been more precise in the question, I'm looking for a cp --backup=numbered equivalent. – Robert Kubrick Oct 12 '12 at 19:07
Look at the --suffix=SUFFIX flag. You can probably get, if not numbered versions, at least dated versions with --suffix=.20121012 – hymie Oct 12 '12 at 19:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .