Fwd: Re: Fwd: rsync and unlink permission
pahud at ezplay.tv
Tue Oct 29 03:34:00 EST 2002
> On Mon, Oct 28, 2002 at 03:12:53PM +0800, Patrick Hsieh wrote:
> > Since "foo" has no write permission under /var/www, he cannot rsync
> > from remote server to the local filesystem because rsync will try to
> > make temp file and unlink the original file before writing over it. Is
> > there any solution to this problem?
> See the -T (--temp-dir) option for how to tell rsync to put its temp
> file in some other directory. If the temp dir is on the same file
> system as /var/www, rsync will still rename the new file over the top of
> the old one (which insures that no one can request a partially-written
> file). If it is on a different file system, rsync will use its
> copy_file() routine to copy the tmp file over the destination file.
My /var/www and /tmp are in different filesystem.
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda3 37980892 3907128 34073764 11% /
/dev/hda1 91556 4988 86568 6% /boot
shmi:/var/www 37980892 1694152 36286740 5% /var/www
If I use "-T /tmp", the error also occurres. Seems rsync will unlink the
original file before copy the new one over. Idea?
$ rsync -a -T /tmp home::www/pahudtestfile ./
unlink pahudtestfile: Permission denied
copy /tmp/.pahudtestfile.v4pXKW -> pahudtestfile : Permission denied
$ rsync --version
rsync version 2.5.6cvs protocol version 26
Copyright (C) 1996-2002 by Andrew Tridgell and others
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
IPv6, 64-bit system inums, 64-bit internal inums
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
Patrick Hsieh<pahud at ezplay.tv>
GnuPG Pubilc Key at http://www.ezplay.tv/~pahud/pahudatezplay.pubkey
MD5 checksum: b948362c94655b74b33e859d58b8de91
More information about the rsync