Author Topic: Using Backup Rsync to a Local Drive  (Read 2528 times)

c4rdinal

  • Zen Samurai
  • ****
  • Posts: 341
  • Karma: +4/-0
    • View Profile
Using Backup Rsync to a Local Drive
« on: February 03, 2014, 04:16:35 am »
Hi,

I mounted a USB Storage with NTFS partition and use it as backup storage.

Partition worked without any issues and can save files to it as /backup directory.

Is there a way I can use RSYNC as backup method instead of Filesystem? If yes how can I accomplish this?

Thanks


christian

  • Guest
Re: Using Backup Rsync to a Local Drive
« Reply #1 on: February 03, 2014, 07:09:35 am »
Do you mean to say that RSYNC is available but that you can't RSYNC on "yourself" ?
I don't know the status with RSYNC on 3.x but running it on 2.2, I remember I had to introduce some customization in order to achieve RSYNC that I could use. You may find it in this forum as I documented it some time ago.

I never tried it but does it make sense to RSYNC with your internal (LAN) IP address ? (weird isn't it ?  :P)

royceb

  • Guest
Re: Using Backup Rsync to a Local Drive
« Reply #2 on: February 03, 2014, 04:00:31 pm »
You can use Rsync just on local directories, the service doesn't have to work for remote devices.  It sounds like your plan is rather simple if I read your description correctly.  If the USB storage device is mounted and ready to go you simply need to create a cron job with the Rsync specified values.  Currently I Rsync two of my Zentyal 3.3 boxes over OpenVPN.

I use Rsync for tons of remote site syncing and found this guide to be rather useful - http://troy.jdmz.net/rsync/index.html

You will want to ignore all the junk regarding SSH and adding SSH keys as well for the script portion that emphasizes variables and turn it into a rsync command.

christian

  • Guest
Re: Using Backup Rsync to a Local Drive
« Reply #3 on: February 03, 2014, 05:12:14 pm »
If you use standard Zentyal implementation, I assume you don't rely on "host::destination" syntax (that is very useful and flexible) because Zentyal won't allow it unless you hardcode some modification  ;)

Lonniebiz

  • Zen Samurai
  • ****
  • Posts: 320
  • Karma: +24/-2
    • View Profile
Re: Using Backup Rsync to a Local Drive
« Reply #4 on: February 03, 2014, 06:06:59 pm »
Some advice:

While the USB drive is unmounted, make its mount-point immutable:
chattr +i /Mount/Point/Location

This will insure that, in the event that the usb is unmounted, nothing will be written to your root partition.

Here's an rysnc command example:
Code: [Select]
sudo rsync -v --chmod=ug=rwX  --human-readable --itemize-changes --links --log-file="rsync.log" --partial --progress --recursive --stats --times /Source/Path/With/Slash/At/The/End/ /Destination/Path/Without/Slash/At/The/End
« Last Edit: February 03, 2014, 06:09:26 pm by Lonniebiz »

c4rdinal

  • Zen Samurai
  • ****
  • Posts: 341
  • Karma: +4/-0
    • View Profile
Re: Using Backup Rsync to a Local Drive
« Reply #5 on: February 05, 2014, 01:46:34 am »
Do you mean to say that RSYNC is available but that you can't RSYNC on "yourself" ?
I don't know the status with RSYNC on 3.x but running it on 2.2, I remember I had to introduce some customization in order to achieve RSYNC that I could use. You may find it in this forum as I documented it some time ago.

I never tried it but does it make sense to RSYNC with your internal (LAN) IP address ? (weird isn't it ?  :P)

Hello Christian,

Thanks for the reply.

For this purpose, I merely want to synchronize the contents of my /home directory to my USB Drive using rsync.

c4rdinal

  • Zen Samurai
  • ****
  • Posts: 341
  • Karma: +4/-0
    • View Profile
Re: Using Backup Rsync to a Local Drive
« Reply #6 on: February 05, 2014, 01:48:50 am »
Some advice:

While the USB drive is unmounted, make its mount-point immutable:
chattr +i /Mount/Point/Location

This will insure that, in the event that the usb is unmounted, nothing will be written to your root partition.

Here's an rysnc command example:
Code: [Select]
sudo rsync -v --chmod=ug=rwX  --human-readable --itemize-changes --links --log-file="rsync.log" --partial --progress --recursive --stats --times /Source/Path/With/Slash/At/The/End/ /Destination/Path/Without/Slash/At/The/End

Hello Lonniebiz,

Thank you for taking time to answer and for the short code. But I just wish to accomplish this over the GUI if ever that's possible.

Thanks again

c4rdinal

  • Zen Samurai
  • ****
  • Posts: 341
  • Karma: +4/-0
    • View Profile
Re: Using Backup Rsync to a Local Drive
« Reply #7 on: February 05, 2014, 01:50:11 am »
If you use standard Zentyal implementation, I assume you don't rely on "host::destination" syntax (that is very useful and flexible) because Zentyal won't allow it unless you hardcode some modification  ;)

Christian,

The hardcode is what I need. hehe :)

Tks

christian

  • Guest
Re: Using Backup Rsync to a Local Drive
« Reply #8 on: February 05, 2014, 08:43:16 am »
The hardcode is what I need. hehe :)

Explained here.

But keep in mind this is hard coded  ;) meaning next release ...  ::)

c4rdinal

  • Zen Samurai
  • ****
  • Posts: 341
  • Karma: +4/-0
    • View Profile
Re: Using Backup Rsync to a Local Drive
« Reply #9 on: February 06, 2014, 10:57:01 am »
The hardcode is what I need. hehe :)

Explained here.

But keep in mind this is hard coded  ;) meaning next release ...  ::)

christian,

Thanks for taking time to answer. Does the script will allow me to map locally the USB drive for my RSYNC backup?

christian

  • Guest
Re: Using Backup Rsync to a Local Drive
« Reply #10 on: February 06, 2014, 11:06:52 am »
Frankly, I never tried (I rsync to another server for obvious backup reasons) but I suppose that if you configure the right rsync listener locally, you should be able to achieve it.

The reason why I hacked Zentyal script is that Zentyal syntax is not convenient (from my standpoint) when it comes to RSYNC.

This being said, behind this simple initial question about RSYNC backup to local drive, there is another wider debate about Zentyal backup usage and purpose that will, if launched, lead us to another debate about availability, redundancy...
I wonder how main Zentyal users handle it  ???