Additional changes to duply-with-powernap post / git add/rm'ing older uncommitted...
[pwan.org.git] / content / hints / duply-with-powernap.rst
index b934cfa..c6e95ad 100644 (file)
@@ -6,19 +6,24 @@ Duply with a powernapping system
 :category: hints
 :author: Jude N
 
-I've started `backing up one of my systems to S3`_.  The instructions from the Phusion blog worked almost perfectly, except my TARGET line was::
+I've started `backing up one of my systems to S3`_.  The instructions from the Phusion blog worked almost perfectly, except my TARGET line was
+
+.. code-block:: bash
  
-  TARGET='s3+http://<my-bucket-name>
+  TARGET='s3+http://<my-bucket-name>'
 
 Also on the AWS side, I set up a lifecycle rule to archive the backups to Glacier after 7 days.
 
-I did run into some issues getting the backups to work together with `powernap`_, which is configured to put the system to sleep after a few minutes of keyboard inactivity.  
+I did run into some issues getting the backups to work together with `powernap`_, which was configured to put the system to sleep after a few minutes of inactivity.  
 
-Powernap was causing a problem on two fronts.  First, the system was going to sleep mid-backup since full backups take longer than the powernap inactivity timeout. The other problem was the backup was scheduled for the middle of the night when the system would normally already be asleep.
+Powernap was causing a problem on two fronts.  First, the system was going to sleep mid-backup since full backups take longer than the powernap inactivity timeout. Second, the backups were scheduled for the middle of the night when the system would normally already be asleep.
 
 To get around the mid-backup sleep issue, I made a /usr/local/bin/duply-nightly script which shuts down powernap before calling duply and restarted it afterwards.
 
-In order to get around the system-already-asleep issue, I'm using `an RTC wakeup`_, in /usr/local/bin/duply-nightly to set the system to wake a few minutes before the cron job kicks off (but not early enough for powernap to put the system to bed again...)
+To get around the system-already-asleep issue, I'm using `an RTC wakeup`_ in /usr/local/bin/duply-nightly to set the system to wake a few minutes before the cron job kicks off (but not early enough for powernap to put the system to bed again...)
+
+The first night I ran the backup, I had to prime the /sys/class/rtc/rtc0/wakalarm time manually, but since then the script has
+set the wakeup time for the next day
 
 The final /usr/local/bin/duply-nightly script is below
 
@@ -26,7 +31,7 @@ The final /usr/local/bin/duply-nightly script is below
 
   #!/bin/sh +x
 
-  /usr/bin/logger "Running nightly backup from $0
+  /usr/bin/logger "Running nightly backup from $0"
 
   # Disable powernap during the backup
   service powernap stop