Difference between revisions of "Network backup FROM Synology TO Amahi"

From Amahi Wiki
Jump to: navigation, search
(How to configure rsync daemon in amahi/ubuntu to allow backups FROM a synology unit)
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
<!--
 
This page is crated automaticaly by a script.
 
This part is commented and shall not show
 
-->
 
<!--At the top of the page can be vissible one of the following tags..-->
 
    {{WorkInProgress}}
 
<!--{{NeedsUpdate}}-->
 
<!--{{NeedsMerge | [[Main Page]]}}-->
 
<!--{{NeedsExpantion}}-->
 
<!--{{NeedsDelete |[[Main Page]]}}-->
 
<!--Please remove or place comment accordingly-->
 
<!--Your text bellow this line-->
 
 
 
 
This is for those trying to get a synology/xpenology box (source) to backup over the network to an Amahi box (target).  I thought that one could fill out the dashboard on the source, and hit the "go" button to start the backup to the HP/Amahi. I found it was not so easy.  This is for Amahi 6/ Ubuntu 12.04.   
 
This is for those trying to get a synology/xpenology box (source) to backup over the network to an Amahi box (target).  I thought that one could fill out the dashboard on the source, and hit the "go" button to start the backup to the HP/Amahi. I found it was not so easy.  This is for Amahi 6/ Ubuntu 12.04.   
  
 
For some reason, xpenology likes an rsync daemon running on the target. So we have to setup the target to be ready.
 
For some reason, xpenology likes an rsync daemon running on the target. So we have to setup the target to be ready.
  
1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd. The entry listed below, should be changed from false to inetd.
+
1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd.  
  
RSYNC_ENABLE=inetd
+
sudo nano /etc/default/rsync
  
 +
:The entry listed below, should be changed from false to inetd.
 +
 +
RSYNC_ENABLE=inetd
  
 
2. Install xinetd on the Amahi box because it's apparently not installed by default.
 
2. Install xinetd on the Amahi box because it's apparently not installed by default.
  
$ sudo apt-get -y install xinetd
+
sudo apt-get -y install xinetd
 +
 
 +
3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd.
  
 +
sudo nano /etc/xinetd.d/rsync
  
3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd. It should contain the following lines of text.
+
:It should contain the following lines of text:
  
service rsync
+
<pre>service rsync
{
+
{  
disable = no
+
disable = no  
socket_type = stream
+
socket_type = stream  
wait = no
+
wait = no  
 
user = root
 
user = root
server = /usr/bin/rsync
+
server = /usr/bin/rsync  
 
server_args = --daemon
 
server_args = --daemon
 
log_on_failure += USERID
 
log_on_failure += USERID
 
flags = IPv6
 
flags = IPv6
}
+
} </pre>
 +
 
 +
:If I have anything other than user = root, I can't get it to work. Don't make it the user below. If I change it to "kevin" (user below) it fails to connect.
  
If I have anything other than user = root, I can't get it to work. Don't make it the user below. If I change it to "kevin" (user below) it fails to connect.
+
4. Create the file /etc/rsyncd.conf configuration on Amahi box to use rsync/daemon.  
  
 +
sudo nano /etc/rsyncd.conf
  
4. Create the file /etc/rsyncd.conf configuration on Amahi box to use rsync/daemon. The file should contain the following.
+
:The file should contain the following.
  
max connections = 2
+
<pre>max connections = 2
 
log file = /var/log/rsync.log
 
log file = /var/log/rsync.log
 
timeout = 300
 
timeout = 300
  
[datashare]
+
[datashare]  
comment = Data backup share
+
comment = Data backup share  
path = /var/hda/files/data
+
path = /var/hda/files/data  
read only = no
+
read only = no  
 
list = yes
 
list = yes
 
uid = kevin
 
uid = kevin
 
gid = nogroup
 
gid = nogroup
 
auth users = kevin
 
auth users = kevin
secrets file = /etc/rsyncd.secrets
+
secrets file = /etc/rsyncd.secrets </pre>
  
I made auth user = kevin and uid = kevin. "kevin" is an amahi user with admin checked (in the user area of Amahi dashboard). For multiple shares to backup to, just copy the "destination module" created by [datashare] above, and paste and edit. In my case I have 4 shares: data, media, backup, autocad. So, I have 4 modules in the rsyncd.conf file.
+
:I made auth user = kevin and uid = kevin. "kevin" is an amahi user with admin checked (in the user area of Amahi dashboard). For multiple shares to backup to, just copy the "destination module" created by [datashare] above, and paste and edit. In my case I have 4 shares: data, media, backup, autocad. So, I have 4 modules in the rsyncd.conf file.
  
 +
5. Create /etc/rsyncd.secrets on Amahi box for user's password.
  
5. Create /etc/rsyncd.secrets on Amahi box for user's password. User should be the same as above, with password the one used to log into/ SSH into the HP/Amahi box.
+
sudo nano /etc/rsyncd.secrets
 
 
$ sudo nano /etc/rsyncd.secrets
 
kevin:theuserpassword
 
  
 +
:User should be the same as above, with password the one used to log into/ SSH into the HP/Amahi box. Format is user:password, like below.
  
 +
:<pre>kevin:theuserpassword</pre>
  
 
6. Then set the file permissions for rsyncd.secrets on the Amahi box.
 
6. Then set the file permissions for rsyncd.secrets on the Amahi box.
  
$ sudo chmod 600 /etc/rsyncd.secrets
+
sudo chmod 600 /etc/rsyncd.secrets
 
 
 
 
  
 
7. Start/Restart xinetd
 
7. Start/Restart xinetd
  
$ sudo /etc/init.d/xinetd restart
+
sudo /etc/init.d/xinetd restart
  
not sure if this was needed, but what the heck.
+
:not sure if this was needed, but what the heck.
  
 +
Now for the source side of things:
 +
# In the xpenology box, load the dashboard/web interface --> mainmenu/backup and replication.
 +
# click "backup destination"
 +
# click "create"
 +
# pick "network destination / rsync compatible" then NEXT
 +
# Name it something you'll understand ... in my case: "data share on Amahi"
 +
# IP address (self explanatory)
 +
# user: kevin
 +
# password: theuserpassword
 +
# backup module: datashare (if you made 4 modules like I did, all 4 are available for selection as backup targets)
 +
# hit APPLY. If it doesn't work, check the user and passwords.
 +
# Do the other modules in the same manner
  
  
Now for the source side of things: In the xpenology box, load the dashboard/web interface --> mainmenu/backup and replication.
+
Now, to setup a backup job on the xpenology box:
click "backup destination"
+
# click "backup" , then "create", then "data backup task"# select the folders to backup (pick one with little data or a test folder to make sure it works)
click "create"
+
# select one of the backup destinations you just created and hit NEXT
pick "network destination / rsync compatible" then NEXT
+
# name the task, say "backup of data to Amahi"
Name it something you'll understand ... in my case: "data share on Amahi"
+
# name the directory on the Amahi share where the backup is going
IP address (self explanatory)
+
# side note: here's where it got interesting. if I leave metadata and thumbnails selected or unselected and I have "kevin" as the user, it works fine. If I have "rsync" as the user with admin permission (as when I was experimenting with the setup) and have the above 2 things selected, the files came over with protections. I couldn't delete some folders of the test run (I think the metadata ones). I'd have to chmod them to be able to delete them. When I deselected them they were deletable. Someone better than me at this can tell me why. Anyhow, I can't see why you'd really need it, so deselect them and give it a shot.
user: kevin
+
# then hit APPLY
password: theuserpassword
 
backup module: datashare (if you made 4 modules like I did, all 4 are available for selection as backup targets)
 
hit APPLY. If it doesn't work, check the user and passwords.
 
Do the other modules in the same manner
 
 
 
  
Now, to setup a backup job on the xpenology box:
 
click "backup" , then "create", then "data backup task"
 
select the folders to backup (pick one with little data or a test folder to make sure it works)
 
select one of the backup destinations you just created and hit NEXT
 
name the task, say "backup of data to Amahi"
 
name the directory on the Amahi share where the backup is going
 
side note: here's where it got interesting. if I leave metadata and thumbnails selected or unselected and I have "kevin" as the user, it works fine. If I have "rsync" as the user with admin permission (as when I was experimenting with the setup) and have the above 2 things selected, the files came over with protections. I couldn't delete some folders of the test run (I think the metadata ones). I'd have to chmod them to be able to delete them. When I deselected them they were deletable. Someone better than me at this can tell me why. Anyhow, I can't see why you'd really need it, so deselect them and give it a shot.
 
then hit APPLY
 
  
 
Do a "backup now" to see if it works and that you can delete the backup directory (no odd permissions). If it works, then you can edit the backup task and put a schedule on it.
 
Do a "backup now" to see if it works and that you can delete the backup directory (no odd permissions). If it works, then you can edit the backup task and put a schedule on it.
  
 
I think I captured everything I did accurately, and I hope that helps someone.
 
I think I captured everything I did accurately, and I hope that helps someone.
 
 
 
 
<!--Your text above this line-->
 
<!--This page must bellong to one of the following categories please remove comment-->
 
<!--[[category:Apps]]-->
 
<!--[[Category:Fedora]]-->
 
<!--[[Category:Platform]]-->
 
<!--[[Category:Pro Version]]-->
 
<!--[[Category:Services]]-->
 
<!--[[Category:VPN]]-->
 

Latest revision as of 20:01, 10 October 2014

This is for those trying to get a synology/xpenology box (source) to backup over the network to an Amahi box (target). I thought that one could fill out the dashboard on the source, and hit the "go" button to start the backup to the HP/Amahi. I found it was not so easy. This is for Amahi 6/ Ubuntu 12.04.

For some reason, xpenology likes an rsync daemon running on the target. So we have to setup the target to be ready.

1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd.

sudo nano /etc/default/rsync
The entry listed below, should be changed from false to inetd.
RSYNC_ENABLE=inetd

2. Install xinetd on the Amahi box because it's apparently not installed by default.

sudo apt-get -y install xinetd

3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd.

sudo nano /etc/xinetd.d/rsync
It should contain the following lines of text:
service rsync
{ 
disable = no 
socket_type = stream 
wait = no 
user = root
server = /usr/bin/rsync 
server_args = --daemon
log_on_failure += USERID
flags = IPv6
} 
If I have anything other than user = root, I can't get it to work. Don't make it the user below. If I change it to "kevin" (user below) it fails to connect.

4. Create the file /etc/rsyncd.conf configuration on Amahi box to use rsync/daemon.

sudo nano /etc/rsyncd.conf
The file should contain the following.
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[datashare] 
comment = Data backup share 
path = /var/hda/files/data 
read only = no 
list = yes
uid = kevin
gid = nogroup
auth users = kevin
secrets file = /etc/rsyncd.secrets 
I made auth user = kevin and uid = kevin. "kevin" is an amahi user with admin checked (in the user area of Amahi dashboard). For multiple shares to backup to, just copy the "destination module" created by [datashare] above, and paste and edit. In my case I have 4 shares: data, media, backup, autocad. So, I have 4 modules in the rsyncd.conf file.

5. Create /etc/rsyncd.secrets on Amahi box for user's password.

sudo nano /etc/rsyncd.secrets
User should be the same as above, with password the one used to log into/ SSH into the HP/Amahi box. Format is user:password, like below.
kevin:theuserpassword

6. Then set the file permissions for rsyncd.secrets on the Amahi box.

sudo chmod 600 /etc/rsyncd.secrets

7. Start/Restart xinetd

sudo /etc/init.d/xinetd restart
not sure if this was needed, but what the heck.

Now for the source side of things:

  1. In the xpenology box, load the dashboard/web interface --> mainmenu/backup and replication.
  2. click "backup destination"
  3. click "create"
  4. pick "network destination / rsync compatible" then NEXT
  5. Name it something you'll understand ... in my case: "data share on Amahi"
  6. IP address (self explanatory)
  7. user: kevin
  8. password: theuserpassword
  9. backup module: datashare (if you made 4 modules like I did, all 4 are available for selection as backup targets)
  10. hit APPLY. If it doesn't work, check the user and passwords.
  11. Do the other modules in the same manner


Now, to setup a backup job on the xpenology box:

  1. click "backup" , then "create", then "data backup task"# select the folders to backup (pick one with little data or a test folder to make sure it works)
  2. select one of the backup destinations you just created and hit NEXT
  3. name the task, say "backup of data to Amahi"
  4. name the directory on the Amahi share where the backup is going
  5. side note: here's where it got interesting. if I leave metadata and thumbnails selected or unselected and I have "kevin" as the user, it works fine. If I have "rsync" as the user with admin permission (as when I was experimenting with the setup) and have the above 2 things selected, the files came over with protections. I couldn't delete some folders of the test run (I think the metadata ones). I'd have to chmod them to be able to delete them. When I deselected them they were deletable. Someone better than me at this can tell me why. Anyhow, I can't see why you'd really need it, so deselect them and give it a shot.
  6. then hit APPLY


Do a "backup now" to see if it works and that you can delete the backup directory (no odd permissions). If it works, then you can edit the backup task and put a schedule on it.

I think I captured everything I did accurately, and I hope that helps someone.