Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
message = This is recommended only for ''Advanced'' users, proceed with caution.}}
</center>
:'''NOTE:''' Although this is for Amahi 6 (Ubuntu), it can be adapted for Amahi 7 or greater . This guide assumes you've followed the [[Enabling_WOL|enabling WOL]] guidance.
 
The purpose of this article is to demonstrate how you can use the Amahi HDA as a part time server.
Although this is for Amahi 6 (Ubuntu), it can be adapted for Amahi 7 (Fedora 19). This guide assumes you've followed the [[Enabling_WOL|enabling WOL]] guidance. This use case example involves an HDA "woken up" each Saturday to receive a backup from a ReadyNAS. Then the HDA turns itself off later in the day. It works flawlessly for me each week. On some Saturdays, I SSH in and update packages as needed.
:1. [[Turning_off_DHCP|Turn off DHCP]] on the HDA.
:2. Download etherwake to the ReadyNAS to be able to WOL the HDA. Start an SSH session into the ReadyNAS, update the package list and install etherwake. Details can be found at [http://manpages.ubuntu.com/manpages/raring/man8/etherwake.8.html etherwake] manpages site.
apt-get update
apt-get install etherwake
::'''NOTE:''' Details can be found at [http://manpages.ubuntu.com/manpages/raring/man8/etherwake.8.html etherwake] manpages site. :3. Setup the WOL script in the /etc/cron.d folder on the ReadyNAS, which runs the script at the time you want. So continuing in the same SSH session, and using Use nano as the editor to create the script wake-HP-NAS. In my case I have an HP Mediasmart, thus the name:
cd /etc/cron.d
sudo nano wake-HP-NAS
:4. Add the line detail you need within nano editor: For me, (where XX...XX is the Mac ID, this wakes up the Amahi unit HDA by the ReadyNAS at 8:54 every Saturday. ): See the man page linked above for all the timing details:
54 8 * * 6 root usr/sbin/etherwake XX:XX:XX:XX:XX:XX
:5. Save and exit the nano editor, the then close the ReadyNAS SSH session.
:6. Next on the HDA, [[Open_Terminal_as_root|open a terminal as root user]]:
sudo nano /etc/crontab
:7. Add the line detail you need at the end. In my case by telling (example instructs the HDA to turn off every Sat at 5pm):
0 17 * * 6 root /sbin/shutdown -h 0
:8. Save and exit, then close the HDA SSH session.
Then you'll need to set backups to run. On the ReadyNAS it is easy. Just fill out simple; complete the backup script fields in the Web UI and make sure they start after the HDA has had time to boot. Also make sure they have enough time to finish. You may want to do the first backup task before the timers are set up as above, to make sure subsequent incremental backups (shorter time) are done in your time window. Hopefully this helps some of you.
12,424

edits