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

From Amahi Wiki
Jump to: navigation, search
 
(3 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.   
  
Line 19: Line 5:
 
1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd.  
 
1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd.  
  
{{Code|
+
sudo nano /etc/default/rsync
Code = sudo nano /etc/default/rsync
 
}}
 
 
 
The entry listed below, should be changed from false to inetd.
 
  
RSYNC_ENABLE=inetd
+
: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.
  
{{Code|
+
sudo apt-get -y install xinetd
Code = sudo apt-get -y install xinetd
 
}}
 
 
 
  
 
3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd.  
 
3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd.  
  
{{Code|
+
sudo nano /etc/xinetd.d/rsync
Code = sudo nano /etc/xinetd.d/rsync
 
}}
 
  
It should contain the following lines of text.
+
:It should contain the following lines of text:
  
service rsync <br />
+
<pre>service rsync
{ <br />
+
{  
disable = no <br />
+
disable = no  
socket_type = stream <br />
+
socket_type = stream  
wait = no <br />
+
wait = no  
user = root <br />
+
user = root
server = /usr/bin/rsync <br />
+
server = /usr/bin/rsync  
server_args = --daemon <br />
+
server_args = --daemon
log_on_failure += USERID <br />
+
log_on_failure += USERID
flags = IPv6 <br />
+
flags = IPv6
} <br />
+
} </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.
  
4. Create the file /etc/rsyncd.conf configuration on Amahi box to use rsync/daemon.
+
sudo nano /etc/rsyncd.conf
{{Code|
 
Code = sudo nano /etc/rsyncd.conf
 
}}
 
  
The file should contain the following.
+
:The file should contain the following.
  
max connections = 2 <br />
+
<pre>max connections = 2
log file = /var/log/rsync.log <br />
+
log file = /var/log/rsync.log
timeout = 300 <br />
+
timeout = 300
<br />
 
[datashare] <br />
 
comment = Data backup share <br />
 
path = /var/hda/files/data <br />
 
read only = no <br />
 
list = yes <br />
 
uid = kevin <br />
 
gid = nogroup <br />
 
auth users = kevin <br />
 
secrets file = /etc/rsyncd.secrets <br />
 
  
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.
+
[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 </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.
  
 
5. Create /etc/rsyncd.secrets on Amahi box for user's password.  
 
5. Create /etc/rsyncd.secrets on Amahi box for user's password.  
  
{{Code|
+
sudo nano /etc/rsyncd.secrets
Code = 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
 
  
 +
: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.
  
{{Code|
+
sudo chmod 600 /etc/rsyncd.secrets
Code = sudo chmod 600 /etc/rsyncd.secrets
 
}}
 
 
 
 
 
  
 
7. Start/Restart xinetd
 
7. Start/Restart xinetd
  
{{Code|
+
sudo /etc/init.d/xinetd restart
Code = 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:
+
Now, to setup a backup job on the xpenology box:
1. In the xpenology box, load the dashboard/web interface --> mainmenu/backup and replication. <br />
+
# 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. click "backup destination" <br />
+
# select one of the backup destinations you just created and hit NEXT
3. click "create" <br />
+
# name the task, say "backup of data to Amahi"
4. pick "network destination / rsync compatible" then NEXT <br />
+
# name the directory on the Amahi share where the backup is going
5. Name it something you'll understand ... in my case: "data share on Amahi" <br />
+
# 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. IP address (self explanatory) <br />
+
# then hit APPLY
7. user: kevin <br />
 
8. password: theuserpassword <br />
 
9. backup module: datashare (if you made 4 modules like I did, all 4 are available for selection as backup targets) <br />
 
10. hit APPLY. If it doesn't work, check the user and passwords. <br />
 
11. Do the other modules in the same manner <br />
 
  
 
Now, to setup a backup job on the xpenology box:
 
1. click "backup" , then "create", then "data backup task" <br />
 
2. select the folders to backup (pick one with little data or a test folder to make sure it works) <br />
 
3. select one of the backup destinations you just created and hit NEXT <br />
 
4. name the task, say "backup of data to Amahi" <br />
 
5. name the directory on the Amahi share where the backup is going <br />
 
6. 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. <br />
 
7. then hit APPLY <br />
 
  
 
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.