Text
So recently I ran into an issue where our backup script would only work properly when we ran it manually. That’s another story. However to try and catch what was wrong with the cron job we had to figure out a way to log what was happening. So what I did was the following on a CentOS machine. I opened the crontab file /etc/crontab and inside there you have four jobs that run at different times:
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
I was running the script under cron.daily so that’s what I wanted to log to see what was happening. So I appended this:
> /home/admin/s3sync/backup.log
so you get:
02 4 * * * root run-parts /etc/cron.daily > /var/log/backup.log
Which will output the results of your cron job to a backup.log text file. The single > will overwrite the log file with every run, which is what I want. If it does it’s job right, there is no reason to hold on to those old logs. Plus I know when it doesn’t work so then I can just check the log for that day. However if you did want the collect the output for each day, you can append the output to the log file by using two » instead of one >. If you do that, I would highly recommend adding that log file to the log rotation script.
I hope this helps anyone is a similar position!
Text
What’s the hassel about?
Apple hasn’t updated the DotMac framework for quite a long time. For more than 2 years. Several months after introducing the DotMac to MobileMe transition, there still isn’t any sign of a MobileMe framework to be used by developers, yet Apple’s using its own private MobileMe framework. Here is a howto for using the MobileMe framework.
What will I need?
Of course, you’ll need Xcode tools and ObjC knowledge, apart from that a piece of Apple’s software with the MobileMe framework (e.g. iPhoto) and our FCMobileMe framework which is a wrapper around the header files. The header files were generated by class-dump command line tool.
Steps
Download the FCMobileMe framework and extract the MobileMe framework from some of Apple’s apps and add those to your project and don’t forget adding them to the Copy Frameworks phase (if you’re not familiar with this, google for ‘Xcode adding framework’).
You may now #import anywhere in your project. The usage is similar to the usage of DotMac kit, which you can download from http://connect.apple.com/ – including a manual. What differs mostly are the class names, which now mostly start with ‘MM_’ – so the classes you should concentrate on are MM_MMiDiskSession, MM_MMMemberAccount and MM_MMTransaction.
Why
Why should you use this weird unofficial way when the old DotMac framework actually does work? There are several reasons:
Text
We decided to change the way we are serving our store and other websites. Fuelcollective.com hosts all the app sites and the store, so it’s important to us that the site is fast, reliable, and efficient.
Our first thought was to have one server that had a lot of RAM that could run all our apps that are in PHP and Ruby on Rails. This worked except memory usage was becoming an issue. We have to run MySQL, PHP, and Ruby (enterprise) and all of those things require a lot of resources.
So as of this week, FueCollective got its own server to use with no PHP installed, just Ruby and MySQL. So far we have seen much improved performance and less resources being used by each server. On top of that, it was actually cheaper to do it this way since the other server can run on a much smaller server. We really only needed the power for the FuelCollective Server.
I’m going to try to write some more geeky articles and possibly be more technical so those with similar issues may get helped by coming across our blog. If you have any questions, please leave a comment.
Text
Just last week we decided to move from MediaTemple to Slicehost. As you may have noticed there where moments of downtime, and some minor issues, but overall we have been happy with the move. Everything is working and back to normal now, but was also a good learning experience. This has been the biggest move I’ve ever had to do.
But this move is part of preparing for the future to make more great products and services.
-Stephen