SOLVED Rsync for backup where to find good instructions

Status
Not open for further replies.

Evertb1

Guru
Joined
May 31, 2016
Messages
700
I believe in automated backup jobs as part of my strategy to keep my precious data OK. I have a FreeNAS box as my one and only file server. At this moment all my backups for my fileserver are done from one of my Windows workstations with automated tasks (all data is available trough shares). The back-up target is a Zyxel NSA325 v2 NAS. Storing back ups is its only reason for being as far as I am concerned.

As my FreeNAS Box is up 24/7 I want to get the workstation out of the equation. So I am looking at rsync. I never have used it before but it sounds promising. The Zyxel NAS supports rsync but it only allows the definition of push jobs, backing up its' own files. In the manual of the thing rsync is not even mentioned. So I need to push the backup jobs form the FreeNAS box. As I find the FreeNAS manual a bit sparse about this subject I would like it if somebody could point me to a reliable resource. I could not find anything in the resources section of the Forum. Of course if somebody out there is already using a similar Zyxel NAS I would not mind getting some pointers.
 
Last edited by a moderator:

HateTheDrake

Dabbler
Joined
Jun 23, 2017
Messages
13
I'll have to look back at what I did, but I'm pushing from FreeNAS to synology via rsync. I setup ssh keys on the root account on FreeNAS, then imported that key on synology.

From there just use the FreeNAS GUI to setup the job.
 
Last edited by a moderator:

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
rsync is a good tool and supported on FreeNAS via GUI. The manual is actually what I used to setup mine. Just take awhile to understand if you've never used rsync (my case at the time).

Today I do it manually as I don't want to run my backup nas 24x7 and a weekly back-up is good enough for me.

For instance:

Code:
rsync --progress -rltzuv root@10.10.10.200:/mnt/raid/cifs ./


Will copy all directories, recursively, from one NAS with IP 10.10.10.200 to the current directory. Note that it will create all directories from the source under the current directory, so you want to run that on the right place. Also people will say its not safe as you are not using a ssh key, etc :)

I didn't see ssh on the Zyxel docs, so not even sure you can do that ...

On a regular scenario, when you are using rsync to sync two systems, one needs to be configured as client and the other as the server.

FreeNAS can be configured for both and the manual explains how. Your problem will be configure the Zyxel, as you already stated it can be only configured to back-up its own files.

If all fails, look at something else, like crashplan, it's available as a plugin on FreeNAS.
 

HateTheDrake

Dabbler
Joined
Jun 23, 2017
Messages
13
I do see what you mean in the manual about rsync push. >> ftp://ftp2.zyxel.com/NSA325/user_guide/NSA325_V4.70%20Ed4.pdf

It does seem to support ssh so you might want to give rsync over ssh a try. These are the steps I did. (from memory, ymmv)

Generate a key via the shell on freenas. https://www.howtoforge.com/linux-basics-how-to-install-ssh-keys-on-the-shell as root.

ssh into zytel and paste the contents of the .ssh/id_rsa.pub file in .ssh/authorized_keys

Setup a rsync job on freenas. Here's mine:

path: /mnt/YourVolumePath
user: root
host: zytel host/ip
ssh port: 22
mode: rsync over ssh
remote path: (example: ) /volume1/NetBackup/FreeNAS
validate remote path: yes
direction: push
min/hour/day: customize to your needs.

check all other boxes except for quiet and delay updates.
Extra options: --verbose --log-file=/mnt/YourVolumePath/rsync.log


HTH.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
Did you try the manual command on the Zyxel shell? See if it works, before you get to the next step.
 

Evertb1

Guru
Joined
May 31, 2016
Messages
700
rsync is a good tool and supported on FreeNAS via GUI.
Yes , I am pretty sure rsync is a good tool and will cover my needs (as soon as I know what I am doing anyway)
Today I do it manually as I don't want to run my backup nas 24x7 and a weekly back-up is good enough for me.
Personally I hate manual backup jobs as I tend to forget them. I hope to be able to use WOL on the Zyxel. Another thing to figure out: how to send the "magic packet" from the Freenas box to the Zyxel(if that is even possible). The Zyxel supports WOL.
I didn't see ssh on the Zyxel docs, so not even sure you can do that ....
I found out SSH is supported. I just needed to get it by the Zyxel Package Manager. The same is true for rsync. Only, that one was hiding in the "Backup Planner" package. Oh well, I found it.
FreeNAS can be configured for both and the manual explains how. Your problem will be configure the Zyxel, as you already stated it can be only configured to back-up its own files.
I have found some hints on the web that the Zyxel can be a target for a rsync push job with ssh. So it must be possible to define a push task on the Freenas box with the Zyxel as target. At this moment that is were I am looking for. If I don't get that working I look into other ways.
I do see what you mean in the manual about rsync push. >> ftp://ftp2.zyxel.com/NSA325/user_guide/NSA325_V4.70%20Ed4.pdf
Yes, in that manual rsync is not an subject. Strange because one would think it would be a nice extra to advertise.

@melloa and @HateTheDrake Thanks for your efforts guys. You have given me enough to build on. Now I have some tinkering to do.
 

Evertb1

Guru
Joined
May 31, 2016
Messages
700
A little update. Things got a bit more involved then I expected. Generating a key and storing the public part on the NAS was easy. Though I needed to read up on some ssh commands like "eval" and "ssh-add". But that was not hard to figure out. At a certain point I got acces to the Shell of the NAS (with SSH) without being asked for a password so it's save to assume that the public key was in place. So far so good.

However creating a "Rsync over SSH" push job failed because the Remote Path did not check out (The Remote Path you specified does not exist or is not a directory ...). With my Windows workstation I could get acces to the target share and directory so it does exists and the directory is valid but it can't be found somehow. Maybe it is because SSH and Rsync on the NAS are implemented to support making backups of the NAS and not the other way around.

I keep on trying some things but in the mean time I am looking at creating a FFP stick (fonz fun_plug) to extend the functionality of the NAS and get a package with a more complete implementation of Rsync. Maybe a Rsync Module job is in my future.
 

HateTheDrake

Dabbler
Joined
Jun 23, 2017
Messages
13
Did you put the actual filesystem path in the remote path? That's what mine was looking for. Zytel could be completely different. Maybe ssh in and do a 'find' command of a known file to see the full path.

eg:

find / -name 'foo.jpg'
 

Evertb1

Guru
Joined
May 31, 2016
Messages
700
Did you put the actual filesystem path in the remote path? That's what mine was looking for. Zytel could be completely different. Maybe ssh in and do a 'find' command of a known file to see the full path.

eg:

find / -name 'foo.jpg'
Yes I attempted that, but "find" is not a build-in command. The list of build-in commands is disappointing short. Ik have also played around with some "grep" commands searching for a file that I know is there. With no result. Wel the NAS was a cheap one so who am I to complain?
 

Evertb1

Guru
Joined
May 31, 2016
Messages
700
I made a last attempt this weekend to get things going before playing around with FFP. I used WinSCP to take a good look in the file system of the Zyxel NAS. I created a share called rsyntarget and in that share I created a folder called "administration". Within this folder I created a file called "findme.txt". This way I should be able to find the file with WinSCP or on the commandline with a grep command.

I started with a search with WinSCP and soon the file was found trough 3 different paths! See screenshot1. Two of those path contained shortcuts (the first and third path). Only the second path seems to be valid. If I used the first or third path in the task I got a "invalid path warning" when saving the task. When I used the second path it was accepted without error and the task could be saved.. However, still no joy. Running the job was without result. But a log file was written and it looks like it will be FFP after all, because this text was in the logfile:
Code:
2017/07/09 16:02:40 [47763] rsync: connection unexpectedly closed (0 bytes received so far) [sender]
2017/07/09 16:02:40 [47763] rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.2]

Looks like one way rsync support to me (from and not to the NAS).
 

Attachments

  • screenshot1.jpg
    screenshot1.jpg
    57.6 KB · Views: 1,493

Evertb1

Guru
Joined
May 31, 2016
Messages
700
A final update on this one. After some tweaking with the repository of the NAS I was able to install a full implementation of rsync and SSH on the NAS. After that, running rsync was easy. However my little NAS showed some performance problems, especially with larger media files. So I decided to recycle an old Asus motherboard with an onboard CPU (AMD Zacate) and 8 GB memory. I pulled the drives out of the NAS and together with a nice little case and a decent PSU I had a fine base for an OpenMediaVault box acting as rsync partner for the Freenas box. It is running as we speak and rsync is working great. Case closed.
 
Status
Not open for further replies.
Top