| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I use rsync to copy files to a different server, maintaining the file directory hierarchy. E.g. I need all files with *.cir extension within subdirectories of / home/user/simscript/20080826_1134: rsync -rlpogtR -v --include "*/" --include "*.cir" --exclude "*" -e ssh /home/user/simscript/20080826_1134 user-at-eda4:/ I need to maintain permissions and mod. time of the copied file. My problem is, that with the above command, also permissions of e.g. / home/user is (potentially) changed. How can (easily) I fix that? Can it be done using rsync? Note that the file MUST be located at the exact same location on both servers. I.e. /home/user/simscript/20080826_1134/foo/bar/foo.test should be copied to that exact location on the destination server. Best regards, Kenneth |
|
#2
|
| If it is not clear from the previous formulations, my question is: How can I copy the files in subdirectories of a given directory (maintaining path, permissions and modification time) without changing the permission of parent directories? /Kenneth |
|
#3
|
| Kenneth Brun Nielsen wrote: > I use rsync to copy files to a different server, maintaining the file > directory hierarchy. > > E.g. I need all files with *.cir extension within subdirectories of / > home/user/simscript/20080826_1134: > > rsync -rlpogtR -v --include "*/" --include "*.cir" --exclude "*" -e > ssh /home/user/simscript/20080826_1134 user-at-eda4:/ > > I need to maintain permissions and mod. time of the copied file. > > My problem is, that with the above command, also permissions of e.g. / > home/user is (potentially) changed. How can (easily) I fix that? Can > it be done using rsync? > > Note that the file MUST be located at the exact same location on both > servers. I.e. /home/user/simscript/20080826_1134/foo/bar/foo.test > should be copied to that exact location on the destination server. > > Best regards, > Kenneth ( cd /home/user/simscript && \ rsync -rlpogtR -v --include "*/" --include "*.cir" --exclude "*" \ -e ssh 20080826_1134 user-at-eda4:/home/user/simscript ) The cd is only effective within the ( ) -- echo imhcea\.lophc.tcs.hmo | sed 's2\(....\)\(.\{5\}\)2\2\122;s1\(.\)\(.\)1\2\11g;1 s;\.;::;2' |
|
#4
|
| On 26 Aug., 13:39, Michael Tosch wrote: > ( cd /home/user/simscript && \ > rsync -rlpogtR -v --include "*/" --include "*.cir" --exclude "*" \ > -e ssh 20080826_1134 user-at-eda4:/home/user/simscript ) Quite obvious - and it works. Thanks ![]() |
![]() |
| Thread Tools | |
| Display Modes | |