Jump to content

Best way to backup unraid to OMV - RSYNC SSH Solution!


Recommended Posts

Hello again! Made a different topic especially for my Rsync problems.

 

Server 1: Unraid

Server 2: OMV

 

Use case:

Backup al essential data nightly from the Unraid server to the OMV server.

 

What works:

rsync -avz -e ssh [email protected]:/mnt/cache/home /

 

So what is the best way to go about configuring the rest?

 

Unraid is running the rsync daemon, I guess..

So adding a task within OMV should do the trick? Well unfortunately not. I think it has something to do with the SSH certificates, which I generated on both machines. But i have no idea where to put them or how to use it in general.

 

So can anyone point me in the right direction?

 

Thanks in advance!

 

 

Link to comment

Google is your friend. I used different source to come up with this, please add is you think something has to be different...

 

Before you go ahead with this, it asumes rsync deamons are runnning on both machines, which in the case of unraid and OMV they are.

Second, it assumes you set up SSH on unraid. I can;t really remember how I did this though  :-X Search for SSH.. If someone knows the steps for enabling SSH please enlighten me.

 

 

1. Test Rsync with password:

rsync -avz -e ssh /home/localmachine/ [email protected]:/backup/remotemachine/ (NOTE: forwardslash in source means copy al CONTENTS of directory, without the directory itself.)

When password is enabled, should ask for it here.

2. ssh-keygen -> when asked for pass just press enter twice

3. The keys are generated now, next step is:

ssh-copy-id  [email protected]

When it asks if you want to continue connecting type yes followed by enter

After a second it asks you for the remote server password, give it..

Should say: 'Number of key(s) added: 1"

4. Type: ssh [email protected] followed by enter..

This time it should not ask for a password..

5. test rsync again: rsync -avz -e ssh /home/localmachine/ [email protected]:/backup/remotemachine/

Should not ask you for a password.. we are getting somewhere :-)

6. Now, you want to run the task every day for example. Cron manages this. Crontab -e uses vi, which i can;t work with (idiot?). So give this command:

export VISUAL=nano; crontab -e

Should use nano now.

Add this line:

10 1 * * * rsync -avz -e ssh /home/localmachine/ [email protected]:/backup/remotemachine/

And it should run 10 past 1 in the night.

To make the cron entry's persisten create a .cron file in your plugin folder!: /boot/config/plugins

 

Still to find out: how te make ssh persistant. Will update on this  :P

 

I tested the rsync commands which work fine for me, I did not test if cron will work this night. Will update.

 

Link to comment

Back to the drawing board.

 

After restart... cron jobs deleted, so looks like the command:

export VISUAL=nano; crontab -e

And adding entry's are NOT persistent, anybody some thoughts about this?

 

After restart I have to copy (via the ssh-copy-id command) the ssh key to autohorty file on OMV as well, any thoughts on this?

 

Thanks again for any  help..

 

 

Link to comment

Back to the drawing board.

 

After restart... cron jobs deleted, so looks like the command:

export VISUAL=nano; crontab -e

And adding entry's are NOT persistent, anybody some thoughts about this?

 

After restart I have to copy (via the ssh-copy-id command) the ssh key to autohorty file on OMV as well, any thoughts on this?

 

Thanks again for any  help..

Unraid is extracted from the archive on the USB drive into RAM every time it is booted. Any file locations not in /boot (flash drive) or /mnt/disk??(plus some other /mnt paths)  are in RAM, and changes are lost on reboot. The /mnt location is only fully populated when the array starts, so best practice is to use the /boot locations to store modifications that you wish to make persistent, and script all changes needed so they can be called at boot time. Prior best practice was to use the go file on the usb drive to call those scripts, I'm not sure what the current recommendation is, but limetech is trying to discourage go file modifications, as they can interfere with automatic upgrades. I'd use the go file method for now, but keep in mind you may have to redo things in the future.
Link to comment
  • 1 month later...
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...