Hi, I'm using rsync for a couple of things but I am at a point where I could not find a solution for my problem. this is what I want to do: rsync only the files i_* from a directory from machine A to machine Bi and delete them from machine B if they on longer exist on machine A. so I use the command: rsync -azv --stats -e ssh --delete i_* user@host:/dir/ When using this command the files starting with i_ will get placed on the remote server or even updated when I change them but if I delete a file on machine A it will not be deleted on machine B. This is only a problem if I use i_* as my source. If i sync whole directories (recursive or not) it's no problem at all to get files deleted on the other end. Is there anything to do about this ? Regards, Pepijn Palmans Kangaroot Linux Solutions Grote Steenweg 91 2600 Berchem, Antwerpen, Belgium Email: pepijn@kangaroot.net
On Tue, Jan 15, 2002 at 10:01:59AM +0100, Palmans Pepijn wrote:> Hi, > > I'm using rsync for a couple of things but I am at a point where I could > not find a solution for my problem. > > this is what I want to do: > > rsync only the files i_* from a directory from machine A to machine Bi > and delete them from machine B if they on longer exist on machine A. > > so I use the command: > > rsync -azv --stats -e ssh --delete i_* user@host:/dir/ > > When using this command the files starting with i_ will get placed on the > remote server or even updated when I change them but if I delete a file on > machine A it will not be deleted on machine B. > This is only a problem if I use i_* as my source. If i sync whole > directories (recursive or not) it's no problem at all to get files deleted > on the other end.That is expected behavior. Rsync would have no way of knowing that it should delete just the missing i_* files or all files in the remote directory.> Is there anything to do about this ?Not if you have any other files that don't start with i_* in the remote directory that you want to keep. If you don't you could use rsync -azv --stats -e ssh \ --include 'i_*' --exclude '*' --delete-excluded . user@host:/dir/ but that will delete all files except the i_* files in host:/dir/. - Dave Dykstra
tim.conway@philips.com
2002-Jan-16 04:53 UTC
problem with --delete if I sync part of a dir
check this out: "echo rsync -azv --stats -e ssh --delete i_*
user@host:/dir/".
it expands to "sync -azv --stats -e ssh --delete <all existing i_*
files> user@host:/dir/" It won't mention the ones that are gone.
rsync the directory/. including i_* and excluding * (the order matters).
rsync -azv --stats -e ssh --delete ./. --include=i_* --exclude=*
user@host:/dir/
Tim Conway
tim.conway@philips.com
303.682.4917
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"
Palmans Pepijn <pepijn@kangaroot.net>
Sent by: rsync-admin@lists.samba.org
01/15/2002 02:01 AM
To: rsync@lists.samba.org
cc: (bcc: Tim Conway/LMT/SC/PHILIPS)
Subject: problem with --delete if I sync part of a dir
Classification:
Hi,
I'm using rsync for a couple of things but I am at a point where I could
not find a solution for my problem.
this is what I want to do:
rsync only the files i_* from a directory from machine A to machine Bi and
delete them from machine B if they on longer exist on machine A.
so I use the command:
rsync -azv --stats -e ssh --delete i_* user@host:/dir/
When using this command the files starting with i_ will get placed on the
remote server or even updated when I change them but if I delete a file on
machine A it will not be deleted on machine B.
This is only a problem if I use i_* as my source. If i sync whole
directories (recursive or not) it's no problem at all to get files deleted
on the other end.
Is there anything to do about this ?
Regards,
Pepijn Palmans
Kangaroot Linux Solutions
Grote Steenweg 91
2600 Berchem, Antwerpen, Belgium
Email: pepijn@kangaroot.net
tim.conway@philips.com
2002-Jan-16 04:58 UTC
problem with --delete if I sync part of a dir
Actually, I think i was wrong. Might it work pulling instead of pushing?
If not, I'll point out that you have ssh access, which makes it easy to
grab the list of what you've got, compare it to what you should have, and
delete what you shouldn't.
Tim Conway
tim.conway@philips.com
303.682.4917
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"
Tim Conway
01/15/2002 10:55 AM
To: Palmans Pepijn <pepijn@kangaroot.net>
cc: rsync@lists.samba.org
Subject: Re: problem with --delete if I sync part of a dir
Classification: Unclassified
check this out: "echo rsync -azv --stats -e ssh --delete i_*
user@host:/dir/".
it expands to "sync -azv --stats -e ssh --delete <all existing i_*
files> user@host:/dir/" It won't mention the ones that are gone.
rsync the directory/. including i_* and excluding * (the order matters).
rsync -azv --stats -e ssh --delete ./. --include=i_* --exclude=*
user@host:/dir/
Tim Conway
tim.conway@philips.com
303.682.4917
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"
Palmans Pepijn <pepijn@kangaroot.net>
Sent by: rsync-admin@lists.samba.org
01/15/2002 02:01 AM
To: rsync@lists.samba.org
cc: (bcc: Tim Conway/LMT/SC/PHILIPS)
Subject: problem with --delete if I sync part of a dir
Classification:
Hi,
I'm using rsync for a couple of things but I am at a point where I could
not find a solution for my problem.
this is what I want to do:
rsync only the files i_* from a directory from machine A to machine Bi and
delete them from machine B if they on longer exist on machine A.
so I use the command:
rsync -azv --stats -e ssh --delete i_* user@host:/dir/
When using this command the files starting with i_ will get placed on the
remote server or even updated when I change them but if I delete a file on
machine A it will not be deleted on machine B.
This is only a problem if I use i_* as my source. If i sync whole
directories (recursive or not) it's no problem at all to get files deleted
on the other end.
Is there anything to do about this ?
Regards,
Pepijn Palmans
Kangaroot Linux Solutions
Grote Steenweg 91
2600 Berchem, Antwerpen, Belgium
Email: pepijn@kangaroot.net