Author Topic: Backup using rsync  (Read 6047 times)

christian

  • Guest
Backup using rsync
« on: May 05, 2012, 11:00:42 am »
Anyone having successfully defined rsync based backup using host::module syntax?
I'm using OpenMediaVault NAS to which I would like to send Zentyal backup.
This NAS is already used to store backup from another NAS (Netgear ReadyNAS) using rsync.
Thus I've defined multiple rsync modules there.

In order to maintain some flexibility and consistency, I would like to align Zentyal backup strategy, in term of target, therefore use "rsync module" but it looks like Zentyal GUI doesn't accept it  :-[
Is it because I'm wrong with syntax or shall I rather move this post to "feature requests"  ???

NB: this is also discussed here.
« Last Edit: May 05, 2012, 03:40:33 pm by christian »

christian

  • Guest
Re: Backup using rsync
« Reply #1 on: May 06, 2012, 12:06:52 am »
Based on another post discussing same topic (see above), I finally modified
/usr/share/perl5/EBox/EBackup/Model/RemoteSettings.pm

as follow:

Code: [Select]
sub _validateTargetForRsync
{
    my ($self, $target) = @_;
    if (not $target) {
        throw EBox::Exceptions::MissingArgument(
                __(q{The RSYNC target parameter that must be like 'other.host[:port]/relative_path' or 'other.host[:port]/absolute_path'})
                );
    }
    my $checkRegex = qr{^([^/:]*?) # host
                       (?::(\d+))? # optional port
                       (/(.*?))?$ # dir
                      }x;

changed to

Code: [Select]
sub _validateTargetForRsync
{
    my ($self, $target) = @_;
    if (not $target) {
        throw EBox::Exceptions::MissingArgument(
                __(q{The RSYNC target parameter that must be like 'other.host[:port]::module'})
                );
    }
    my $checkRegex = qr{^([^/:]*?) # host
                       (?::(\d+))? # optional port
                       (::(.*?))?$ # dir
                      }x;

and this works now  ;)
1 - I can setup backup using host::module syntax
2 - such backup works  8)

vshaulsk

  • Zen Samurai
  • ****
  • Posts: 477
  • Karma: +9/-1
    • View Profile
Re: Backup using rsync
« Reply #2 on: May 15, 2012, 01:34:36 am »
Christian... I followed you and installed Open Media Vault.  I like it a lot more the FreeNas and Openfiler.

I am trying to setup Rsync..... do I have to change the code in Zentyal?   I guess I don't understand the module vs the shared folder path...

host:(port#)/shared folder  ............host::Module (would it be host:(port#):module)

christian

  • Guest
Re: Backup using rsync
« Reply #3 on: May 15, 2012, 06:45:19 am »
Yes, indeed, OMV is very promising. I too prefer OMV compared to FreeNAS and Openfiler.
Still, there is, AFAIK, no LDAP authentication but AD  :-[ at least for the time being.

"module" is what you defined in rsyncd.conf (rsync server side). This is how rsync exposes its own "share" (kind of), therefore this the default (at least from my standpoint  ;) ) syntax.

If you type
Code: [Select]
rsync server::What you get is the list of existing modules...

and if you want to use it, yes you will have to modify Zentyal code.
I'm not sure my own modification is the most clever one however  :-[ even if it works  :)

christian

  • Guest
Re: Backup using rsync
« Reply #4 on: March 10, 2013, 08:56:18 am »
Replying to myself in order to bump this topic, hoping Zentyal team may perhaps have a look at fix it  ::)

Yesterday I tried to configured another rsync based backup.
Obviously it didn't work out of the box. Looking at "/usr/share/perl5/EBox/EBackup/Model/RemoteSettings.pm" I realized it was back to its original (and wrong BTW content).
I applied again my quick (and dirty) fix but I really wonder why Zentyazl dev can't do it  :o

Or I'm the one totally stupid and, in fact, it work  ???