Updating a copy on staging server using svn up and later doing cp command to copy the files from the updated copy to the server copy is always time consuming when there are more than 10 files. Can you suggest me a way of how to do this without copying the .svn files and also saving time? Writing bash script is my aim to resolve this issue. Can I use rsync ?
I think you are asking how can you get updated files to a target server from Subversion?!? If so...
Use Subversion's svn export.
svn export --force https://urlofsvnhost/repo/product/branches/stable /path/to/www/public
This will export the subversion folder contents w/o any .svn folder turds.
We have our post-commit hook setup to rsync (with appropriate excludes) to each of our servers.
rsync --exclude-from 'excludes_file' -av --del /local/path/ remote:/remote/path
The excludes file we are using has .svn as a pattern.
You could also just
rsync --exclude '.svn' ....