Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
 
<!--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.
1. Edit the file /etc/default/rsync in the Amahi box to start rsync as daemon using xinetd.
{{Code|Code = sudo nano /etc/default/rsync}} The entry listed below, should be changed from false to inetd.
RSYNC_ENABLE=: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.
{{Code|Code = sudo apt-get -y install xinetd}} 
3. Create the file /etc/xinetd.d/rsync on Amahi box to launch rsync via xinetd.
{{Code|Code = sudo nano /etc/xinetd.d/rsync}}
:It should contain the following lines of text:
<pre>service rsync <br />{ <br />disable = no <br />socket_type = stream <br />wait = no <br />user = root <br />server = /usr/bin/rsync <br />server_args = --daemon <br />log_on_failure += USERID <br />flags = IPv6 <br />} <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.
{{Code|
Code = sudo nano /etc/rsyncd.conf
}}
The file should contain the following sudo nano /etc/rsyncd.conf
max connections = 2 <br />log :The file = /var/log/rsyncshould contain the following.log <br />timeout = 300 <br />
[datashare] <br /pre>comment max connections = Data backup share <br />2path log file = /var/hdalog/files/data <br />read only = no <br />rsync.loglist timeout = yes <br />uid = kevin <br />gid = nogroup <br />auth users = kevin <br />secrets file = /etc/rsyncd.secrets <br />300
I made auth user [datashare] comment = Data backup share path = /var/hda/files/data read only = no list = kevin and yesuid = kevin. "gid = nogroupauth users = 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 secrets file = /etc/rsyncd.conf file.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.
{{Code|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.
{{Code|Code = sudo chmod 600 /etc/rsyncd.secrets}}  
7. Start/Restart xinetd
{{Code|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: <br />
1. In the xpenology box, load the dashboard/web interface --> mainmenu/backup and replication. <br />
2. click "backup destination" <br />
3. click "create" <br />
4. pick "network destination / rsync compatible" then NEXT <br />
5. Name it something you'll understand ... in my case: "data share on Amahi" <br />
6. IP address (self explanatory) <br />
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:
# 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
Now, to setup a backup job on the xpenology box: <br />
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.
I think I captured everything I did accurately, and I hope that helps someone.
 
 
<!--Your text above this line-->
[[Category:Platform]]
12,424

edits