Re: delete files

2011-11-14 Thread Brian K. White

On 11/14/2011 2:29 AM, Voelker, Bernhard wrote:

rsync -avx --delete --include=/file --exclude='*' . host2:deltest/.


This didn't work for me, although one difference is my script specifies 
a path instead of "." Does this only work with literally "." in the 
places above?


My script parses the given command line into a path/file 
(dirname/basename) pair and drops the path part in the same places you 
have "." above.


Basically, to push a file out to all hosts, the user says:
pushfile /path/to/some/thing [host(s)...]

(* optional target host(s), defaults to all hosts listed in a config 
file if not specified)


That normally results in:
P=/path/to/some
F=thing
h=target_host
OPTS=-acv
rsync $OPTS ${P}/$F ${h}::root$P


For the new delete mode it detects if the supplied argument doesn't 
exist locally and does this instead:

P=/path/to/some
F=thing
h=target_host
OPTS="-acv --delete"
rsync $OPTS --include=/$F --exclude='*' $P ${h}::root$P

Which to me looks the same as what you did except that I'm using an 
explicit full path with leading "/" in $P instead of "."


But when it runs the remote file is not deleted.

After creating /tmp/floof/{1,2,3} locally and pushing that all out to a 
remote box, then deleting /tmp/floof/2 locally, then trying to push out 
the non-existing /tmp/floof/2 to the same remote host, I just get:


--
sending incremental file list
rsync: link_stat "/tmp/floof/2" failed: No such file or directory (2)

sent 12 bytes  received 12 bytes  48.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) 
(code 23) at main.c(1042) [sender=3.0.7]

--

--
bkw
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: delete files

2011-11-14 Thread Brian K. White

On 11/14/2011 2:29 AM, Voelker, Bernhard wrote:

Brian K. White wrote:


Is there any way to specify a file to be deleted on the remote side
explicitly by name?


yes :-)

user@host1:~/deltest>  ls -a1
.
..
a
b
c
file
user@host1:~/deltest>  ssh host2 ls -a1 deltest
.
..
a
b
c
file
user@host1:~/deltest>  rm file
user@host1:~/deltest>  rsync -avx --delete --include=/file --exclude='*' . 
host2:deltest/.
building file list ... done
deleting file
./

sent 96 bytes  received 26 bytes  244.00 bytes/sec
total size is 0  speedup is 0.00
user@host1:~/deltest>  ssh host2 ls -a1 deltest
.
..
a
b
c
user@host1:~/deltest>


Have fun,
Berny


Ahhh much better than what I did thank you!

And I even already use dynamically generated temp include/exclude files 
all the time too, not even like it's something I'm unfamiliar with.


Thanks again.

--
bkw
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Rsync with special characters

2011-11-14 Thread Wayne Davison
On Wed, Nov 9, 2011 at 7:02 AM, Philip Kimgård wrote:

> "rsync -avz -e 'ssh -p *special**port*' 
> *user*@*windowsmachine*:/cygdrive/c/Åtest
> --iconv=CP1252,utf-8 *(Also tride ISO8859-1 and utf-8)*"
>

Checkout the manpage on --protect-args:

If you use this option with --iconv, the args related to the remote side
will also be translated from the local to the remote character-set.  The
translation happens before wild-cards are expanded.

Without that, rsync (really ssh) just sends the bytes you specify exactly
as you specify them, so you need to specify the right ones for the remote
side or use one or more wild-cards (e.g. "??" would match a two-byte
special character in many shells).

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: Not all files copied

2011-11-14 Thread L. V. Lammert
On Mon, 14 Nov 2011, Mike Brown wrote:

> I can't run it as root, as root login via ssh is not allowed for security
> reasons.
>
PMFJI, but there *are* secure ways to allow root login - check out "forced
command only".

We run a number of rsnapshot/rsync jobs as root, but the only command
allowed is "rsync".

Lee
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Mike Brown
On Mon, Nov 14, 2011 at 01:15:49PM -0500, Kevin Korb wrote:
> The main thing I wanted to show you was how to setup sshd to only allow
> root to log in via an ssh key and to restrict that ssh key to only being
> allowed to run rsync.  That is much easier and more secure than setting
> up rsyncd with uid=0

FYI, port 873 should be blocked by my DSL router's firewall, if the thing is
working correctly.

MB
-- 
e-mail: vid...@vidiot.com | vid...@vidiot.net/~\ The ASCII
[I've been to Earth.  I know where it is. ]  \ / Ribbon Campaign
[And I'm gonna take us there.Starbuck  3/25/07]   X  Against
Visit - URL: http://vidiot.com/ | http://vidiot.net/ / \ HTML Email
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: excluding dot file/dir only in user home dir

2011-11-14 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Assuming that the rsync source is the user's home dir: --exclude='/.*'
If you are backing up all of /home and want the same rules for all
users then: --exclude='/*/.*'

On 11/14/11 13:57, Fabrizio Pollastri wrote:
> Hi all, I am looking for the proper rsync command to backup a whole
> user dir recursively, excluding dot file/dir at the first level
> (user home) but not in subdirectories.
> 
> TIA, Fabrizio Pollastri

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7BZREACgkQVKC1jlbQAQcCfQCgvBMJo7YmMddcHL8LI+Qzl7Qu
tEMAnA7qYmFPZK8T+uUmx1e+cBkgzkUN
=w/ZY
-END PGP SIGNATURE-
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


excluding dot file/dir only in user home dir

2011-11-14 Thread Fabrizio Pollastri

Hi all,
I am looking for the proper rsync command to backup a whole user dir 
recursively, excluding dot file/dir at the first level (user home) but 
not in subdirectories.


TIA,
Fabrizio Pollastri
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


excluding dot file/dir only in user home dir

2011-11-14 Thread Fabrizio Pollastri

Hi all,
I am looking for the proper rsync command to backup a whole user dir 
recursively, excluding dot file/dir at the first level (user home) but 
not in subdirectories.


TIA,
Fabrizio Pollastri
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Mike Brown
On Mon, Nov 14, 2011 at 01:15:49PM -0500, Kevin Korb wrote:
> There was more in there than just sudo or rsyncd.  In fact the FAQ
> advises against using sudo.

Ya, I saw that.  It suggested changed to ssh for root to get it.  The point
was that configuration of some sort was needed, no matter which method was
used.  Added the changes to the rsyncd.conf file was extremely easy.

> The main thing I wanted to show you was how to setup sshd to only allow
> root to log in via an ssh key and to restrict that ssh key to only being
> allowed to run rsync.  That is much easier and more secure than setting
> up rsyncd with uid=0

Once the files are copied, the rsync daemon will be disabled.  But, if I
were going to be using rsync consistantly over time, I would indeed fix up
ssh to do what is suggested.  For a one-time thing, never to be used again,
using the daemon and rsyncd.conf is a little easier :-)

MB
-- 
e-mail: vid...@vidiot.com | vid...@vidiot.net/~\ The ASCII
[I've been to Earth.  I know where it is. ]  \ / Ribbon Campaign
[And I'm gonna take us there.Starbuck  3/25/07]   X  Against
Visit - URL: http://vidiot.com/ | http://vidiot.net/ / \ HTML Email
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Kevin Korb
There was more in there than just sudo or rsyncd.  In fact the FAQ
advises against using sudo.

The main thing I wanted to show you was how to setup sshd to only allow
root to log in via an ssh key and to restrict that ssh key to only being
allowed to run rsync.  That is much easier and more secure than setting
up rsyncd with uid=0

On 11/14/11 12:56, Mike Brown wrote:
> On Mon, Nov 14, 2011 at 12:42:55PM -0500, Kevin Korb wrote:
>> http://www.sanitarium.net/rsyncfaq/#sudo
> 
> You either set up a rsyncd.conf file (easily done) and run rsync as a daemon
> or set up sudo.  I don't have sudo set up, so 6 of one, half dozen of the
> other :-)
> 
>> This might be a good idea.  It is a fairly common question.  OTOH,
>> launching as root to be able to bind to a privileged port# then dropping
>> privileges to user nobody is fairly common in services designed to
>> distribute data.  Such as Apache.
> 
> Being common and actually doing that are two different things.  One doesn't
> know that is being done unless told and right now that warning, not even a
> warning actually, is buried in the rsycnd.conf man page.
> 
> But, as you say, it is a common question, so maybe something along the line
> of what I suggested should be in the rsync man page, in a section that should
> be seen by users.  I certainly read the section I suggested.  :-)
> 
> Well, soon I'll be starting the transfer of 1TB of data to the new 4TB raid.
> 
> MB

-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Mike Brown
On Mon, Nov 14, 2011 at 12:42:55PM -0500, Kevin Korb wrote:
> http://www.sanitarium.net/rsyncfaq/#sudo

You either set up a rsyncd.conf file (easily done) and run rsync as a daemon
or set up sudo.  I don't have sudo set up, so 6 of one, half dozen of the
other :-)

> This might be a good idea.  It is a fairly common question.  OTOH,
> launching as root to be able to bind to a privileged port# then dropping
> privileges to user nobody is fairly common in services designed to
> distribute data.  Such as Apache.

Being common and actually doing that are two different things.  One doesn't
know that is being done unless told and right now that warning, not even a
warning actually, is buried in the rsycnd.conf man page.

But, as you say, it is a common question, so maybe something along the line
of what I suggested should be in the rsync man page, in a section that should
be seen by users.  I certainly read the section I suggested.  :-)

Well, soon I'll be starting the transfer of 1TB of data to the new 4TB raid.

MB
-- 
e-mail: vid...@vidiot.com | vid...@vidiot.net/~\ The ASCII
[I've been to Earth.  I know where it is. ]  \ / Ribbon Campaign
[And I'm gonna take us there.Starbuck  3/25/07]   X  Against
Visit - URL: http://vidiot.com/ | http://vidiot.net/ / \ HTML Email
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/14/11 12:38, Mike Brown wrote:
> On Mon, Nov 14, 2011 at 10:36:39AM -0500, Kevin Korb wrote:
>> rsync -avzH host:/path/ /path/
>>
>> No new daemon or config file needed.
> 
> That is how I started out.  But, when run as me, it will not copy over files
> that belong to other users.
> 
> I can't run it as root, as root login via ssh is not allowed for security
> reasons.

http://www.sanitarium.net/rsyncfaq/#sudo

> The UID/GID issue with the server is a nasty bit of fine print that is only
> found in the rsyncd.conf man mage.  It would be real user friendly to have a
> note in the "Starting rsync daemon to accept connections:" section of the
> rsync man page saying that using the daemon results in it running as user
> and group "nobody" and to see the rsyncd.conf uid/gid module directives for
> more detail.

This might be a good idea.  It is a fairly common question.  OTOH,
launching as root to be able to bind to a privileged port# then dropping
privileges to user nobody is fairly common in services designed to
distribute data.  Such as Apache.

> MB

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7BUx8ACgkQVKC1jlbQAQcKggCgl6D/QXuVjMVS4XEkT+4G5Cu4
KZ4An1gMFCef+sxEBSFCInlfxydfaOSf
=zpqc
-END PGP SIGNATURE-
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Mike Brown
On Mon, Nov 14, 2011 at 10:36:39AM -0500, Kevin Korb wrote:
> rsync -avzH host:/path/ /path/
> 
> No new daemon or config file needed.

That is how I started out.  But, when run as me, it will not copy over files
that belong to other users.

I can't run it as root, as root login via ssh is not allowed for security
reasons.

The UID/GID issue with the server is a nasty bit of fine print that is only
found in the rsyncd.conf man mage.  It would be real user friendly to have a
note in the "Starting rsync daemon to accept connections:" section of the
rsync man page saying that using the daemon results in it running as user
and group "nobody" and to see the rsyncd.conf uid/gid module directives for
more detail.

MB
-- 
e-mail: vid...@vidiot.com | vid...@vidiot.net/~\ The ASCII
[I've been to Earth.  I know where it is. ]  \ / Ribbon Campaign
[And I'm gonna take us there.Starbuck  3/25/07]   X  Against
Visit - URL: http://vidiot.com/ | http://vidiot.net/ / \ HTML Email
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Also, for a one time thing it is generally much easier to run rsync over
ssh than it is to setup the rsync daemon and config file...

rsync -avzH host:/path/ /path/

No new daemon or config file needed.

On 11/14/11 05:02, Paul Slootman wrote:
> On Mon 14 Nov 2011, Mike Brown wrote:
>>
>> For the most part, all of the directories are being copied, but there are
>> files that it refuses to copy.  For example:
>>
>> -rw---   1 brown146 Jul 31 20:58 .TTauthority
>>
>> Any file that is 600 it will leave behind and list it as permission denied.
>>
>> Root is doing the work on both ends, as I start the rsync daemon as root.
> 
> Did you note the fact that the rsync daemon will by default do its work
> as user "nobody"?  Search for "uid" in the rsyncd.conf manpage.
> 
> 
> Paul

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7BNYcACgkQVKC1jlbQAQcWHgCcDhkRFrgzv4WECHAMvvMtjOSS
2eIAniKOaqnJNuW3e63LeJbB6RfmyyCZ
=dH0X
-END PGP SIGNATURE-
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


using iconv - how?

2011-11-14 Thread Yan Seiner
I am trying to use iconv to copy files from a UTF-8 machine to a iso8859 
machine.  The target is an embedded box with no UTF-8 support.


I've tried both --iconv=utf-8,iso88591 and --iconv=. and the result is 
the same:


[sender] cannot convert filename: Chris Botti _ Michael Bubl\#351 
(Invalid argument)
[sender] cannot convert filename: Stan Getz/Ballads and Bossa Nova/\#311 
Preciso Perdoar.mp3 (Invalid or incomplete multibyte or wide character)
[sender] cannot convert filename: Stan Getz/Compact Jazz/So Dan\#347o 
Samba (I Only Dance S.mp3 (Invalid or incomplete multibyte or wide 
character)
[receiver] cannot convert filename: Unknown Artist/Unknown 
Album/\#345\#265\#220- Believe (PV).mp3 (Invalid or incomplete multibyte 
or wide character)
[generator] cannot convert filename: Unknown Artist/Unknown 
Album/\#345\#265\#220- Believe (PV).mp3 (Invalid or incomplete multibyte 
or wide character)
[receiver] cannot convert filename: Yothu Yindi/Tribal 
Voice/Dj\#303\#244pana.mp3 (Invalid or incomplete multibyte or wide 
character)
[generator] cannot convert filename: Yothu Yindi/Tribal 
Voice/Dj\#303\#244pana.mp3 (Invalid or incomplete multibyte or wide 
character)


And the file is not copied.

Can anyone suggest where I should look?  I built rsync with iconv 
support, the libraries are in place, and it's clearly trying to do 
something and failing.


--
Few people are capable of expressing with equanimity opinions which differ from 
the prejudices of their social environment. Most people are even incapable of 
forming such opinions.
   Albert Einstein

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Mike Brown
On Mon, Nov 14, 2011 at 11:02:29AM +0100, Paul Slootman wrote:
> Did you note the fact that the rsync daemon will by default do its work
> as user "nobody"?  Search for "uid" in the rsyncd.conf manpage.

Nope, I did not.  Will go looking,  Thanks.

MB
-- 
e-mail: vid...@vidiot.com | vid...@vidiot.net/~\ The ASCII
[I've been to Earth.  I know where it is. ]  \ / Ribbon Campaign
[And I'm gonna take us there.Starbuck  3/25/07]   X  Against
Visit - URL: http://vidiot.com/ | http://vidiot.net/ / \ HTML Email
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Not all files copied

2011-11-14 Thread Paul Slootman
On Mon 14 Nov 2011, Mike Brown wrote:
> 
> For the most part, all of the directories are being copied, but there are
> files that it refuses to copy.  For example:
> 
> -rw---   1 brown146 Jul 31 20:58 .TTauthority
> 
> Any file that is 600 it will leave behind and list it as permission denied.
> 
> Root is doing the work on both ends, as I start the rsync daemon as root.

Did you note the fact that the rsync daemon will by default do its work
as user "nobody"?  Search for "uid" in the rsyncd.conf manpage.


Paul
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html