Press "Enter" to skip to content

Category: computers

Time Machine for… FreeBSD?

This week I finally got around to writing a new backup script for my webserver. I have it automatically pushing backups to a device at home, but in the past I’d only been doing a nightly rsync with --delete and periodic offline backups. The problem with this was that should something happen to my server and cause a data loss, but not be noticed before the next backup ran, the current backup would be modified reflect the now-compromised data, potentially causing massive data loss. Clearly this was a bad thing, and something had to be done.

A new backup scheme was devised and now that the new scripts are tweaked I wanted to present them here. rsync is still being used, but thanks to its glorious --link-dest option which makes hard links as it can, files already stored on disk (say, from a previous version of the backup) are reused, saving space. This is how Apple's Time Machine works, just without the nice GUI. The result is that I have a series of directories starting with backup.0 up through potentially backup.30 on the target, each containing a different backup. The suffixed number represents how many versions old the backup is. These versions are generally created once per day, but on days where the backup does not complete successfully the version is not incremented.

To start, there is a script called dailybackup.sh which runs once per day on banstyle.nuxx.net. This script pushes a backup to a Mac at home as follows:

  1. If needed, remotely execute rotatebackup.sh on the backup server. This will move backup.0 to backup.1, backup.1 to backup.2, keeping no more than 30 backups. The need to rotate backups is determined by the presence of backup.0/backup_complete. If there is no backup_complete file we know that the previous backup was not successful and that we should reuse backup.0.
  2. Create a new backup.0 and populate it with a backup_started flag file.
  3. Run the backup job via rsync.
  4. If the job completes successfully (exits with something other than 0 or 24), continue. Exit code 24 indicates that some files disappeared during backup, and as mail files (amongst others) tend to move and be deleted by users during the backup job, this is not a critical error for us.
  5. Remove backup_started and create the backup_complete flag.

Copies of the aforementioned scripts can be found here, if you’d like to look at / use them: dailybackup.sh · rotatebackups.sh

These scripts assume the presence of backup.0, a full copy of your backup, which you’ll have to create yourself before use. There’s also likely some necessary changes for your environment, most likely in some of the variables set at the top of the scripts, such as the number of days for which to keep backups and logs, the target hostname, SSH port, username, etc.

Leave a Comment

SyncForegroundPolicy precludes ReportDC and ReportControllerMissing

In troubleshooting some Group Policy processing issues I attempted to set ReportDC(1) and ReportControllerMissing(2) to notify me, upon login, that a Windows machine was using Cached Credentials(3). After a brief period of confusion I found that turning off (or setting to 0) SyncForegroundPolicy, the registry key which holds the policy setting Always wait for the network at computer startup and logon, will preclude this the aforementioned notification. Thus when receiving the policy-based setting disabling SyncForegroundPolicy to ensure that the machine starts faster by not waiting for the network to come up before beginning policy processing, the diagnostic popup indicating the use of cached credentials does not work.

Note that the steps for setting the ReportDC and ReportControllerMissing values can be found in 242536 – User is not alerted when logging on with domain cached credentials.

(1) HKU\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ReportDC, set to 1 (the default) to display the domain controller message.
(2) HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ReportControllerMissing, set to TRUE to display the message.
(3) HKLM\Software\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon\SyncForegroundPolicy, set to 1 for enabled / wait for network. The opposite setting of 0 is disabled / don’t wait for network.

Leave a Comment

Brown Food and Maths

In the last twelve hours I have seen Alton Brown give a nice lecture and Q&A (which makes up for missing him in Michigan), eaten at a restaurant which uses Papyrus on its sign and does not suck, and watched the Babbage Difference Engine No.2 (Serial No.2) in action. I just finished eating one each of a Russian spinach pie and apple pie, and Danielle is flying out here now. At some point tomorrow we should be up in San Francisco, and more good food is scheduled to be eaten between now and then.

Leave a Comment

Now Approaching Ludicrous Size

The iMac has arrived, and its 27″, 2560×1440 display is simply absurd. While perspective in the the image above doesn’t make it look that large, the Apple flying-esque intro video almost made me feel motion sick. The 15″ Dell Latitude D620 (which I’m using while data migrates from the Mac Pro) feels netbook-esque, and the older 20″ Dell UltraSharp 2005FPW feels dimunitive. It is also very quiet, which is wonderful.

Leave a Comment

Cascaded USB Hubs

As part of rewiring my office I purchased this seven-port USB hub from Firefold for $22.99, part number USB-7P-HUBSP. It turns out that this hub is actually two Genesys Logic GL852G hub chips, with one cascaded off of the other. The three ports shown above on the left are connected to the first hub, then the other four are connected to the second hub chip. Thus when the case is closed up (as seen here) ports 1-4 are on one hub which is connected to the hub that ports 5-7 are on. This shouldn’t cause a problem, but it’s a much cheaper design than using a seven port hub chip and having everything at the same level.

The hub also ships with a 5V 2.5A switching power supply. Having seven ports which can supply a maximum of 500mA each, this power supply cannot fully power the hub. That said, most devices never pull anywhere near 500mA, so this shouldn’t be a problem either.

Leave a Comment

Printed In The Closet

Over the weekend I moved the printer into the closet. It’s much happier in there as there isn’t much dust, and it’s much more out of the way. After the Mac Pro is gone I can remove the rack, freeing up even more space. I’d originally had some network cable issues where things would link but not work, but a quick test tonight showed that one end wasn’t as well crimped as it should have been, so redoing that end sorted out the network.

Time was also spent on more mundane around the house chores, with some dishes being done, dead plants being removed from planters, patio furniture put away, and glass put in the storm doors. I’m hoping to clean some every day up until I leave on vacation. With the forecast of rain and snow for this week I don’t think I’ll be doing much biking, so there should be plenty of time. There’s something very nice about coming back from vacation to a clean house.

Leave a Comment

Acoustically Dampened Hard Disk Shelf

With an iMac soon to replace my Mac Pro, I’ve had to set up some external disks to take care of extra storage and backup needs. Most hard disk enclosures contain fans and are a bit noisy, so I decided to move them to a place where I won’t be able to hear them: in the floor beneath my desk. As was done back when I had a fibre channel disk array in the basement I’m running a cable through the wall and floor, except this time the drives will be located sitting on an acoustically dampened (with neoprene) shelf, and connected via Firewire / IEEE1394b.

To build the shelf I used 1/2″ birch plywood and applied neoprene to most of it using contact cement (picture). A space was left for an APC Back-UPS ES (BE550G) which will be used to provide power to the disk enclosures (picture). The space above where the shelf will fit was then lined with the remaining neoprene, stapled in place using my Dad’s staple gun (picture). The board was then screwed in place using a number of drywall screws, with them concentrated around the UPS end, as it will bear more weight (picture). With a layer of neoprene between the base and the joists I didn’t tighten the screws down fully, as this should provide some additional isolation between the board and the floor.

I expect that once they are located on the shelf I will not be able to hear the fan in the rather noisy Vantec NexStar NST-400MX-UFB or the disk access in either it or the Macally PHR-100ACB. This will make for a nicely quiet computing experience in my office, with plenty of room to fit more Firewire disk enclosures should the iMac need additional expansion.

Leave a Comment

It’s Made Of People!

This power supply, the Solytech Enterprise Corporation AC Adapter Model AD5012G came with the Vantec NexStar NST-400MX-UFB that arrived today and I keep misreading the label as ‘Soylentech’. This disk enclosure will eventually be used with the replacement for my Mac Pro, a 27″ iMac with Core i7 processors. Since the iMac only has one internal disk I’ll be using Firewire disks to add additional spindles for virtual machines, Time Machine, etc. I’m still not sure where I’ll put the drives, but my current thought is either on the back side of my desk, or in the basement, suspended from the ceiling.

After first disconnecting it I found the fan in the NST-400MX-UFB to be necessary, as the drives were becoming quite warm without it. As this fan is fairly loud, I think I’ll be placing the drives in the basement, in a slightly soundproofed enclosure. Today after work I picked up a rather lengthy roll of neoprene from the foam factory and it should go quite a ways towards eliminating fan noise that may emanate from the enclosure through the floor. Some smart baffeling may cut down one the sound in the basement too.

Leave a Comment

I Love Michigan’s Scanner Law

I love what is known as Michigan’s Scanner Law. In short, this law states that if one is charged more than the stickered price for an item rung up via a computer scanning a bar code, one is legally eligable to be refunded the overcharged amount plus ten times the overcharged amount, with a cap of $5 on this surplus. In this case I went in to Office Max to check the price on a Logitech LX8 mouse. It was marked as $29.99, so I purchased it. As expected, it rang up for the normal price of $39.99 and the cashier didn’t notice the stickered price.

After a quick walk out of the store then back in I returned to the cashier and asked her about the difference, which she promptly refunded. I had to remind her about the aforementioned Michigan Scanner Law, but doing so resulted in a manager being called over and my receiving an extra $5 cash. Thus, what’s normally a $39.99 MSRP mouse ($49.99 at Office Depot) was obtained for $26.79.

The last time I took advantage of this I obtained a large quantity of 2GB SD (20 or so) cards from Micro Center, most of which were marked $5.99. I was charged $6.99 per card, and upon visiting the customer service desk I was refunded $1/card. When I reminded the cashier of the scanner law she simply re-rang all the cards at $1.99/ea, essentially a $5 penalty per item. When multiple items have their price adjusted the store must correct the price on all and refund the difference, but they are only obligated to pay the 10x penalty once, but if Micro Center wanted to do otherwise, I was not going to go out of my way to correct them.

Leave a Comment