Re: rsync from apache

2008-05-21 Thread david reinares
This is just a workaround, but you could modify the apache account to
have a home directory.
Then you generate a pair of private/public keys and put the private in
.ssh directory in the apache home directory
and copy the public key into the authorized_keys in .ssh in the
external server's user account used to rsync to.
Just remember of the perms. The home directory .ssh and the private
key in yor computer must belong to the apache user,
and the authorized keys and .ssh dir in the external server to the
user you use to rsync to. And the perms in that .ssh and authorized
keys must be 700.
Good luck.

---
Hello,

I have a bash script update.sh that contains:
rsync -- delete -avz -e ssh ${files} [EMAIL PROTECTED]:/red
when I use that script  ./update.sh as root, it works like a charm as I set up
the private/public key  properly.
When run from a php script through the apache  webserver
?php
exec(update.sh);
?
The  rsync line is ignored.
I understand that the php script is called under  the apache user, when the
private/public key is for my root user. How can I  set the the keys so that the
apache user can run fully the php  script?
Thank you
-- 
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

source-filter_dest-filter patch failing with rsync 3.0.0

2008-05-19 Thread david reinares
I'm using the source-filter option in this patch with the command
rsync.exe -a -v -e ssh --source-filter=/cygdrive/c/openssl.exe enc -des3
-pass pass:whatever -a /cygdrive/c/backup [EMAIL PROTECTED]:
to crypt files to be sent at source with openssl.

At some point rsync fails an i get
104435520 [main] rsync 1040 _cygtls::handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
104436464 [main] rsync 1040 open_stackdumpfile: Dumping stack trace to
rsync.exe.stackdump
107286788 [main] rsync 1040 _cygtls::handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
107318448 [main] rsync 1040 _cygtls::handle_exceptions: Error while dumping
state (probably corrupted stack).

I know this patch was updated for rsync 2.6.9 because it failed, but i think
it's not been updated lateri need to use version 3.0.x because of the
--iconv option.

I've performed an strace and the output for the error was:

50 9020694 [main] rsync 1040 fhandler_disk_file::readdir: 0 = readdir
(0x100875D0, 0x22AE84) (Header.html)
  110 9020804 [main] rsync 1040 lstat64: entering
   57 9020861 [main] rsync 1040 normalize_posix_path: src backup/pruebas
sftp/áraña/html/lib/Encode/MIME/Header.html
   54 9020915 [main] rsync 1040 cwdstuff::get: posix /cygdrive/c
   45 9020960 [main] rsync 1040 cwdstuff::get: (/cygdrive/c) = cwdstuff::get
(0x22A910, 260, 1, 0), errno 0
   42 9021002 [main] rsync 1040 normalize_posix_path:
/cygdrive/c/backup/pruebas sftp/áraña/html/lib/Encode/MIME/Header.html =
normalize_posix_path (backup/pruebas
sftp/áraña/html/lib/Encode/MIME/Header.html)
   70 9021072 [main] rsync 1040 mount_info::conv_to_win32_path:
conv_to_win32_path (/cygdrive/c/backup/pruebas
sftp/áraña/html/lib/Encode/MIME/Header.html)
   44 9021116 [main] rsync 1040 mount_info::cygdrive_win32_path: src
'/cygdrive/c/backup/pruebas sftp/áraña/html/lib/Encode/MIME/Header.html',
dst 'c:\backup\pruebas sftp\áraña\html\lib\Encode\MIME\Header.html'
   43 9021159 [main] rsync 1040 set_flags: flags: binary (0x2)
   42 9021201 [main] rsync 1040 mount_info::conv_to_win32_path: src_path
/cygdrive/c/backup/pruebas sftp/áraña/html/lib/Encode/MIME/Header.html, dst
c:\backup\pruebas sftp\áraña\html\lib\Encode\MIME\Header.html, flags 0x2A,
rc 0
   78 9021279 [main] rsync 1040 symlink_info::check: not a symlink
   43 9021322 [main] rsync 1040 symlink_info::check: 0 = symlink.check
(c:\backup\pruebas sftp\áraña\html\lib\Encode\MIME\Header.html, 0x22A5D0)
(0x2A)
   42 9021364 [main] rsync 1040 path_conv::check:
this-path(c:\backup\pruebas sftp\áraña\html\lib\Encode\MIME\Header.html),
has_acls(1)
   43 9021407 [main] rsync 1040 build_fh_pc: fh 0x6116A2B8
   39 9021446 [main] rsync 1040 stat_worker: (backup/pruebas
sftp/áraña/html/lib/Encode/MIME/Header.html, 0x22AE50, 1, 0x6116A2B8),
file_attributes 32
   43 9021489 [main] rsync 1040 fhandler_base::open: (c:\backup\pruebas
sftp\áraña\html\lib\Encode\MIME\Header.html, 0x11)
   71 9021560 [main] rsync 1040 fhandler_base::set_flags: flags 0x11,
supplied_bin 0x1
   49 9021609 [main] rsync 1040 fhandler_base::set_flags: O_TEXT/O_BINARY
set in flags 0x1
   39 9021648 [main] rsync 1040 fhandler_base::set_flags: filemode set to
binary
   51 9021699 [main] rsync 1040 fhandler_base::open: 0 = NtCreateFile
(0x654, 20080, c:\backup\pruebas
sftp\áraña\html\lib\Encode\MIME\Header.html, io, NULL, 0, 7, 1, 4000, NULL,
0)
   51 9021750 [main] rsync 1040 fhandler_base::open: 1 = fhandler_base::open
(c:\backup\pruebas sftp\áraña\html\lib\Encode\MIME\Header.html, 0x11)
   47 9021797 [main] rsync 1040 fhandler_base::open_fs: 1 =
fhandler_disk_file::open (c:\backup\pruebas
sftp\áraña\html\lib\Encode\MIME\Header.html, 0x1)
   70 9021867 [main] rsync 1040 get_file_attribute: file: c:\backup\pruebas
sftp\áraña\html\lib\Encode\MIME\Header.html
  131 9021998 [main] rsync 1040 cygpsid::debug_print: get_sids_info: owner
SID = S-1-5-21-1844237615-1220945662-725345543-1003
   54 9022052 [main] rsync 1040 cygpsid::debug_print: get_sids_info: group
SID = S-1-5-21-1844237615-1220945662-725345543-513
   46 9022098 [main] rsync 1040 get_info_from_sd: ACL 1C0, uid 1003, gid 513
   70 9022168 [main] rsync 1040 fhandler_base::fstat_helper: 0 = fstat (,
0x22AE50) st_atime=4831505D st_size=4002, st_mode=0x81C0,
st_ino=281474977041002, sizeof=96
   47 9022215 [main] rsync 1040 fhandler_base::close: closing
'/cygdrive/c/backup/pruebas sftp/áraña/html/lib/Encode/MIME/Header.html'
handle 0x654
   69 9022284 [main] rsync 1040 stat_worker: 0 = (backup/pruebas
sftp/áraña/html/lib/Encode/MIME/Header.html, 0x22AE50)
  140 9022424 [main] rsync 1040 geterrno_from_win_error: windows error 18 ==
errno 89.

I'd appreciate any help

P.S: As you can see i'm using rsync with cygwin. but I don't think that's
the source of the error (i hope)
-- 
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: 

Re: crypting remote data

2008-03-11 Thread david reinares
I did as you said..the program calls openssl after rsync to decrypt
restored data...

But the patch has serious problems...besides the dest-filter error,
testing large amount of data (well, not such large, 70 Mbs),
i received this message..

html/lib/perl5db.html
  9 [main] rsync 2760 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_V
IOLATION
608 [main] rsync 2760 open_stackdumpfile: Dumping stack trace to rsync.exe.s
tackdump
1870590 [main] rsync 2760 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_V
IOLATION
1909558 [main] rsync 2760 _cygtls::handle_exceptions: Error while dumping state
(probably corrupted stack)

This patch needs really hard work and lots of testing...reading the
list i think i saw something similar

rsync error: STATUS_ACCESS_VIOLATION

Rob Bosch
Thu, 25 Oct 2007 17:56:19 -0700


I don't know if it's the same failure or the same cause...


I guess i'll have to figure out another way to rsync and crypt in a
efficient way..another idea?


By the way thank you very much and sorry for the inconveniences


-
On Mon, 2008-03-10 at 22:55 +0100, david reinares wrote:
 After testing a bit more i discovered that fails when i pass the
 command to restore and decrypt with dest-filter (in the client side).
 Always the same file, no matter how many times i execute rsync. But
 after testing diferent folders, i can't see the conection between the
 failed files. html, java, etc, but all of them with more files exactly
 like them in the folder but rsync'd and decrypted perfectly.
 If i do the same with source-filter (server side) it seems to work ok,
 i can restore all files. But that is a problem, because we don't want
 to have the files decrypted in the server not even for a second,
 appart of the fact that having a big bunch of clients restoring at the
 same time with all the hard work of decrypting in the server side
 would overload the server.


 --
 Very good this patch...thank you

 I've been testing this after patching rsync, and works fine to backup...but

 when I'm restoring the crypted data after a while rsync shows
 rsync: Failed to close: Bad file descriptor (9)
 rsync: Failed dup/close: Bad file descriptor (9)
 rsync error: error in IPC code (code 14) at pipe.c(208) [receiver=3.0.0]

 rsync error: error in IPC code (code 14) at pipe.c(195) [receiver=3.0.0]
 rsync: connection unexpectedly closed (55 bytes received so far) [generator]
 rsync error: error in rsync protocol data stream (code 12) at io.c(600)

 [generat
 or=3.0.0]

 It's a bit strange. It restores some files before failing, and they are
 perfectly decrypted...i'm using openssl as command

I will look into the problem with the patch if I get a chance.  One
workaround for restoring files would be to rsync the desired files to
the target machine without filtering and then decrypt them there (with
rsync and --source-filter or just a shell script).

Matt
-- 
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: crypting remote data

2008-03-10 Thread david reinares
Very good this patch...thank you

I've been testing this after patching rsync, and works fine to backup...but
when I'm restoring the crypted data after a while rsync shows
rsync: Failed to close: Bad file descriptor (9)
rsync: Failed dup/close: Bad file descriptor (9)
rsync error: error in IPC code (code 14) at pipe.c(208) [receiver=3.0.0]
rsync error: error in IPC code (code 14) at pipe.c(195) [receiver=3.0.0]
rsync: connection unexpectedly closed (55 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(600)
[generat
or=3.0.0]

It's a bit strange. It restores some files before failing, and they are
perfectly decrypted...i'm using openssl as command
---

On Sat, 2008-03-08 at 18:33 +0100, david reinares wrote:
 rsyncrypto looks fine, but still not which we're looking for.

 Having a complete file updated if a little change happens doesn't
 bother me. We're performing daily rsync, so not many files can be
 changed in a day.

 The real problem is about space and performance. If you want good
 performance yo have to sacrifice space, and vice versa.

 We decided to save space for client. so we copy file by file, crypt
 it, rsync it, and then delete...a hell for performance, starting a
 rsync connection for each file.
 And worst of all, we loose -b functionality, that was really good
 (having not just a copy of the day before but an extra day)...having a
 previous version of destination data
 in a file by file basis is not a god idea.

I don't understand what problem you are having with -b; could you please
clarify?  Suffixed backups should work exactly the same way when
rsyncing one file at a time as they did when you rsynced all the files
at once.  The same is true of backups with --backup-dir, provided that
you use --relative so you can specify the same destination argument for
every run.

 Any idea to get the -b funcionality back again and obtain a compromise
 between space and performance?

To fix the performance while keeping the space usage low, look into the
source-filter_dest-filter branch of rsync:

http://rsync.samba.org/ftp/rsync/dev/patches/source-filter_dest-filter.diff

You could run rsync once for all the files and specify your encryption
program as the --source-filter, and rsync would call your encryption
program once per file as needed.

Matt
-- 
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: crypting remote data

2008-03-08 Thread david reinares
rsyncrypto looks fine, but still not which we're looking for.

Having a complete file updated if a little change happens doesn't bother me.
We're performing daily rsync, so not many files can be changed in a day.

The real problem is about space and performance. If you want good
performance yo have to sacrifice space, and vice versa.

We decided to save space for client. so we copy file by file, crypt it,
rsync it, and then delete...a hell for performance, starting a rsync
connection for each file.
And worst of all, we loose -b functionality, that was really good (having
not just a copy of the day before but an extra day)...having a previous
version of destination data
in a file by file basis is not a god idea. And to have the --delete
functionality we need to play a trick at the end with a new rsync passing
all directories and --ignore-existing, --ignore-non-existing, --delete, just
to have same files in source and destination (thank you very much Matt
McCutchen).

About duplicity is not a good idea, at least for us. We don't want to have
tar directories and such things.

Any idea to get the -b funcionality back again and obtain a compromise
between space and performance?


On Tue, 4 Mar 2008, david reinares wrote:

 It would be greatful to have crypting funcionality added to rsync, appart
 from using ssh to crypt transmissions.

 I know this is not the original purpose for rsync, but anyway it's a fact
 that many people need (at least i need, I hope I'm not alone)
 additional security features for offsite backups, like having the data
 crypted at remote, but not at source, so the problem is crypting the data
 and then syncronizing it.

There are a couple of things which try to do this, eg. duplicity, but none
which fully hit the nail on the head. The killing factor for duplicity is
that to expire increments you need to do a new full backup.

rsyncrypto is probably what comes closest to the goal, it would be ideal
though if rdiff-backup was to be combined with rsyncrypto to do it all in
one - I personally use a three stage process using tar, rsyncrypto and
then rdiff-backup (and then rsync).

When rsyncrypto gets working stdin/stdout support then the tar/rsyncrypto
stage could be combined into one.
-- 
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: Directory with ! in filename

2008-03-06 Thread david reinares
I had the same problem synnizing between windows and linuxwhen you pass
the path and has an space, you have to add a \ just before the space

(cygdrive/c/Documments\ and\ Settings). This is because linux way to
encode file names with spaces.

I think its only in the linux path, but just play with it in source and dest

Other problem to deal with is the character conversion. Windows use
ISO8859-1 but Linux uses UTF8...when dealing with some special characters
like `, ñ, ç, etc, rsync could backup to a linux server, but not restore
from the linux server. Solution was to use rsync 3.0's new iconv feature,
where you can select  local and dest  characters set.  Using no conversion
for backing up (file names are saved as windows, so they look weird in the
linux server because linux read them as UTF8), but rsync
--iconv=ISO_8859-1,ISO_8859-1... to restore (put names in windows as windows
format and read from linux as windows also) worked well for me.

This iconv feature is present only in 3.0 so I suggest you to update.

I hope this will help you.
___

I've been getting the error below and the only thing I can see odd about the
directory is the ! in the directory name.  That and there is a space at the
end of the text which doesn't seem like it should be there either.  There
are no permissions issues with accessing the directory and the directory
does exist.  Does anyone know if the ! will cause a problem or will rsync
escape the special character?  Is the space at the end of the quotes a
problem with the error message or is something else going on?  I'm going
from a Windows client using cygwin to a Linux receiver/server.  I'm still
using 3.0.0pre10.

rsync: opendir /cygdrive/j/Documents and Settings/All Users/Start
Menu/Programs/ACT! 2006  failed: No such file or directory (2)

Thanks!

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

crypting remote data

2008-03-04 Thread david reinares
I don't know if this is the propper place to ask for new funcionality, but
after searching the website i didn't find another place to do it.
I'm very sorry if I`m asking this in the wrong place.

It would be greatful to have crypting funcionality added to rsync, appart
from using ssh to crypt transmissions.

I know this is not the original purpose for rsync, but anyway it's a fact
that many people need (at least i need, I hope I'm not alone)
additional security features for offsite backups, like having the data
crypted at remote, but not at source, so the problem is crypting the data
and then syncronizing it.

I've programmed a wrapper in java that do it, but it's very time and
resources consuming. The idea was to copy file by file in a temp dir, crypt
the file, rsync it, and delete the file.
I go from top to down sending the source (subdirs). About sending the data
file by file, the question is many times we have very large files and/or
very large dirs, so imposing the user to have the same amount of free space
that he/she wants to send it's not a good idea I guess. It isn't a bad
solution, but neither a good one. Perfect should be having support to it
from rsync.

It is just an idea to improve rsync.

Thank you very much in advance and again sorry if this wasn't the list to
post a request.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

delete without copy

2008-03-03 Thread david reinares
I'm programming an aplication to remote backup using rsync. The user has the
option to crypt the files before sending them, but that options is causing
us a lot of problems.
We can´t crypt the original content, so we do a temporal copy. The problem
is we just cant copy all files at the same time if they are big enough, so
if a folder is bigger tan a size prefixed by the user, we copy file by file,
crypt the file, send it and delete the crypted copy. That way it's imposible
to delete files removed from sourceIs there any way to run rsync to
create a file list and just delete files not present at source?...but
without sending diferences..that way I can send file by file, and after that
compare clear folders at source against crypted folders at destiny and get
files deleted

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