I propose two solutions not all using scp:
1. Use .ssh/config to help
Ie: put something like this in your .ssh/config
Host p
HostName production.domain.com
Host d
HostName development.domain.com
Then you can shorten your scp command:
scp user@d:/path user@p:/path
2. Use source control software like git. So when you're done with debugging and coding and stuff, you do this (simplified):
git add /path/to/my_file
git commit -m "new version and features done"
git push production master
(Just setup your git to use ssh)
3. Use qscp, or quick-scp - a bash script designed especially for your convenience :)
https://github.com/zladuric/quick-scp
Basically, get the qscp file and make it executable. (and change the defaults to your environment).
It will take one mandatory and two optional parameters. Example:
./qscp file # it will use defaults
./qscp path/to/dir dest.server.com # uses default source, but to other dest
./qscp /abs/path/to/file dest.srv.com src.srv.com # takes both dest and source server args
The scrpt should be easy to customize to your specific needs, but it is not extremely robust yet. You may have to adjust location of the scp binary, your ssh_key files or something similar.
How about them apples? :)
scpisn't working with brace expansion (braces). Any example? – altmas5 Aug 5 '12 at 19:54scp. The command you wrote is expanded by the shell intoscp user@dev-server:/path/to/file user@production-server:/path/to/file. – Gilles Aug 5 '12 at 20:16