Is there a way to copy files form one server to another and to leave permisions and owners in place. I have the same users/groups on other server. Thanks.
On Thursday 10 Mar 2005 20:36 pm, Scorpy wrote:
Is there a way to copy files form one server to another and to leave permisions and owners in place. I have the same users/groups on other server.
Check out the options for the cp command in man cp - especially cp -a <file> Dylan
Thanks.
-- "I see your Schwartz is as big as mine" -Dark Helmet
On Thu, 2005-03-10 at 15:44, Dylan wrote:
On Thursday 10 Mar 2005 20:36 pm, Scorpy wrote:
Is there a way to copy files form one server to another and to leave permisions and owners in place. I have the same users/groups on other server.
Check out the options for the cp command in man cp - especially cp -a <file>
Don't know that I would trust the cp command. One slip and you'll have a lot of problems. The better solution would be yo use either tar or rsync. tar will keep perms without any special command line switches (defaults are good enought). rsync works really (works with ssh for a secure transfer) good but you have to make sure to use the proper switches. scp will do a secure copy if you are going across the internet but again make sure you use the right switches. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
Is there a way to copy files form one server to another and to leave permisions and owners in place. I have the same users/groups on other server. Yes. If you use NFS, the cp(3) command has a -p (or --preserve) option to
On Thursday 10 March 2005 3:36 pm, Scorpy wrote:
preserve permissions. Rsync and scp also have the -p option as does tar.
--
Jerry Feldman
On Fri, 11 Mar 2005 07:36 am, Scorpy wrote:
Is there a way to copy files form one server to another and to leave permisions and owners in place. I have the same users/groups on other server.
rsync is THE tool-of-choice here. Worth learning, even just for making copies on the same machine. Like cp use "-a" to preserve all meta-data (ownerships, permissions times etc) Type "rsync --help" and have a look. To copy files between different machines it can use: ssh (no configuration required, good for low volume) rsh (Fast, high volume, but need to set up rsh trust.) ONLY do this on totally secure private subnets. nfs (better to nfs-mount the filesystem being read) rsync server (fast, secure, but needs to be set up) The unique thing about rsync is that it doesn't have to copy all the data every time, it can refresh an existing copy, excellent for "spinning backup". michaelj -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166
participants (5)
-
Dylan
-
Jerry Feldman
-
Ken Schneider
-
Michael James
-
Scorpy