[docs] [wayned@: Re: Remote file deletion]

Dmitry V. Levin ldv на altlinux.org
Чт Окт 28 21:00:23 MSD 2004


В доку (если ещё не).

----- Forwarded message from Wayne Davison <wayned@> -----

Date: Thu, 28 Oct 2004 09:54:00 -0700
From: Wayne Davison <wayned@>
To: Dale Amon <amon@>
Cc: rsync на lists.samba.org
Subject: Re: Remote file deletion

On Thu, Oct 28, 2004 at 01:15:18PM +0100, Dale Amon wrote:
> I've looked at the shell command hack but don't see a way to get a
> remote 'rm /mydir/foo' to execute that way.

If you're using ssh or rsh as your rsync connection, you can simply do
this:

    ssh host rm /mydir/foo /mydir/bar /yourdir/baz

or even this:

    ssh host xargs rm -rf </tmp/local-list-of-files-and-dirs

If you're trying to do this by talking to a daemon or a restricted
rsync-only ssh setup, you should be able to transfer an empty directory
with some simple excludes to do what you want, but it's easiest to copy
into each directory separately.  For instance, if you want to delete
mydir/foo, mydir/bar, and yourdir/baz on host "host" in module "mod",
you could do this:

mkdir emptydir
rsync -av --include=foo --include=bar --exclude='*' --delete emptydir/ host::mod/mydir
rsync -av --include=baz --exclude='*' --delete emptydir/ host::mod/yourdir
rmdir emptydir

..wayne..
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

----- End forwarded message -----

-- 
ldv
----------- следущая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : отсутствует
Тип     : application/pgp-signature
Размер  : 189 байтов
Описание: отсутствует
Url     : http://lists.altlinux.ru/pipermail/docs/attachments/20041028/514d9e25/attachment.bin


Подробная информация о списке рассылки docs