If you are reading “The Swift Programming Language” from iBooks & wondering how-to run sample code from it, here is how…
Time Machine is one of the nicest feature in Mac, which helps recovering files from backups and also a big savior during system crashes. However, this standard & powerful feature doesn’t come without a price. By default, when Time Machine’s automated backup is on, it runs on the background and keeps track of changes happening to the system. But the problem is, the Time Machine’s background process can be resource intensive and it can fight with other applications & processes that you are working on and ultimately leave us in poor system behavior & crashes. One way to deal with this situation is to schedule Time Machine backups during times when you don’t normally/excessively use the system. But, that is not one of the feature currently available in Mac as standard(at least in Mac Lion v1.7). So, here comes the help from cron scheduler and tmutil…
I had setup my Time Machine backups to run at 1 am everyday. So, it can run during times where I don’t normally work on my system. Following are the steps to get this setup.
- First thing, you need to turn off automated backups from Time Machine preferences as illustrated in the following screenshot. Another thing is, if you already don’t have Time Machine status on menu bar enabled, you may want to turn that ‘on’, so you can check on the status faster & quicker.
- Schedule Time Machine CLI util command using crontab to run at 1am everyday.
crontab -e& enter the following line and save the crontab file.
This setting may vary depending on your need. If you want to run backups more often, please adjust the settings accordingly.
- Sometime next day, check the backup status & make sure it ran successfully.
Hope this helps
As you may or may not aware that capturing screenshot from Java (stand alone, applet or webstart) was made easier with the help of java.awt.Robot. But due to the fact that multiple monitors have become a common place, its a challenge to figure out the bounds, width & height of the monitor you are currently on for capturing the screenshot. In this specific case, I would want to capture the screenshot of the current active monitor ie. where my mouse is pointing at that instance. After playing around with screen geometries, I finally came up with this code snippet and thought it might be useful for someone else. I have tested this code from standalone & applet in Java version 1.6.0_26 on Windows 7. Hopefully, it should work fine in other platforms as well.