Showing posts with label mozy. Show all posts
Showing posts with label mozy. Show all posts

Wednesday, February 6, 2008

My Mozyhome Automation Script:

As I mentioned in a previous post, I really like Mozyhome but I don't like having it constantly running in the background; it really only needs to run when it performs a backup, and any other time it shouldn't be wasting my RAM and CPU. So here's a handy Autohotkey script I've written that'll automate starting, running, and killing Mozyhome automatically.

Here's the full script, which I've called mozybackup.ahk:

#SingleInstance force
DetectHiddenText, On
SetTitleMatchMode 2
SetTitleMatchMode, Slow

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 5000

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 10000

WinWait, ahk_class wxWindowClassNR
IfWinNotActive, ahk_class wxWindowClassNR, , WinActivate, ahk_class wxWindowClassNR,
WinWaitActive, ahk_class wxWindowClassNR,
MouseClick, left, 347, 41

WinWait, ahk_class wxWindowClassNR, 1 minute ago
Run, C:\Program Files\PSTools\pskill.exe "mozybackup.exe"
Run, C:\Program Files\PSTools\pskill.exe "mozystat.exe"
Run, C:\Documents and Settings\Arvin\My Documents\scripts\finishedbackup.txt

Alright, now let's go through each part of the script to explain what it does, in case you need to alter parts of it later on (which I'm sure you'll have to).

#SingleInstance force
DetectHiddenText, On
SetTitleMatchMode 2
SetTitleMatchMode, Slow

This part kind of sets the tone for the rest of the script. The first line makes sure only one instance of the script is running. The next three lines sets Autohotkey to actively and thoroughly read the text inside currently open windows. You'll see why this is important later.
run C:\Program Files\MozyHome\mozystat.exe

Sleep, 5000

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 10000
This part runs Mozyhome. If you installed Mozyhome into a different directory, change the file path as appropriate. The reason I call the program twice is because mozystat.exe usually starts minimized in the system tray, where I can't get at it. The second run command brings up the Mozyhome window to the top of the desktop. The long sleep times allow time for Mozyhome to properly load in plenty of time.

WinWait, ahk_class wxWindowClassNR
IfWinNotActive, ahk_class wxWindowClassNR, , WinActivate, ahk_class wxWindowClassNR,
WinWaitActive, ahk_class wxWindowClassNR,
MouseClick, left, 347, 41

This part waits for activates the Mozyhome window if it hadn't already (wxWindowClassNR is the ahk_class or window class of the Mozyhome window). The last line clicks the "Start Backup" button on the Mozyhome window, which starts the backup.
WinWait, ahk_class wxWindowClassNR, 1 minute ago
Run, C:\Program Files\PSTools\pskill.exe "mozybackup.exe"
Run, C:\Program Files\PSTools\pskill.exe "mozystat.exe"
Run, C:\Documents and Settings\Arvin\My Documents\scripts\finishedbackup.txt

The first line of this next section waits for the Mozyhome window to display the term "1 minute ago," which would show up as soon as the backup finishes. The script is paused at this point until that phrase in that window pops up.

Once it finishes, it runs PSKill to kill the mozybackup.exe and mozystat.exe processes. I'd featured PSKill before, but basically it force closes the specified processes. I've put pskill.exe into a folder called PSTools in my Program Files folder, but again, if you've put it elsewhere, make sure you put the right path in there.

Finally, the last line opens a text file called finishedbackup.txt that I'd prewritten and saved in my scripts folder that just simply says "Finished backup!" I just put it in there to let me know the backup finished successfully. You don't need to do this part, or customize it yourself with whatever text file you want. I decided against using a MsgBox because the script won't close unless the OK button on the MsgBox is clicked. With the text file, the script can open the file, and then close itself.

And there you go! To run this script, either just run it by double clicking whenever you want to, or incorporate it into another script and have it run from a specific keystroke. I have it run as part of my computer's shutdown routine, which I invoke with a simple ALT-H at the end of the night, or in the morning before I head out to work.

Thursday, January 17, 2008

MozyHome Video Tour

For those of you who want more of a primer to using Mozy Home prior to applying the MozyHome tweaks I wrote about earlier, here's a video tour on YouTube for using Mozy Home:





Youtube's becoming increasingly great for software and hardware tutorials, and I'll try to embed related videos to my posts more often.

Tuesday, January 15, 2008

MozyHome Settings

I'd already gone over Mozy twice now in previous posts, but this time around I'll go over the exact custom settings I use, as well as other tweaks to make sure not only that my important data is backed up but also that MozyHome stays out of the way as much as possible.

First and foremost, here's a screenshot of the Backup Sets I currently have:


I've kept the music set turned off because I have far more music than the 2 gigabytes of free space MozyHome gives you for free, plus those are backed up in my MP3 player anyway. Notice that I have it set to back up my instant messenger logs as well as my Firefox bookmarks.

Next, here is my Options window. Emphasis is on making it user-friendly when it's running, but out of the way when it's not needed:

Then, in the "Schedule" tab, I have it set to suspend automatic and scheduled backups. With my Autohotkey-scripted Standby/Hibernate routine set to go every night (or whenever I press Alt-H), MozyHome runs at least 7 times a week, oftentimes more (as I usually run the routine when I leave for work and when I go to bed). This way I can keep MozyHome shut down 99% of the time, not taking up extra resources. Speaking of which, I have the MozyHome backup Windows Service set to Manual so it doesn't become part of the startup routine.

Here's the Autohotkey script that controls Mozy's functions:

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 5000

WinWait, MozyHome Remote Backup (1.8.4.7) - Status,
IfWinNotActive, MozyHome Remote Backup (1.8.4.7) - Status, , WinActivate, MozyHome Remote Backup (1.8.4.7) - Status,
WinWaitActive, MozyHome Remote Backup (1.8.4.7) - Status,
MouseClick, left, 210, 18
Sleep, 8000
Send, s
Sleep, 5500

WinWait, MozyHome Remote Backup (1.8.4.7) - Status, 1 minute ago
Run, C:\Program Files\PSTools\pskill.exe "mozybackup.exe"
Run, C:\Program Files\PSTools\pskill.exe "mozystat.exe"
Run, C:\Documents and Settings\Arvin\My Documents\scripts\finishedbackup.txt
The first WinWait routine waits until Mozyhome finishes loading, activates the window, then hits "S" to start the backup.

The second WinWait routine waits until the phrase "1 minute ago" shows up in the window. This means that the backup just finished. It then runs PSKill, a utility used for fast killing processes (MozyHome won't just quit by closing the window). Finally it opens up a premade text file that says "Backup Finished!" which awaits me when I bring the computer out of standby.

(Feel free to use the script and tweak it as you wish. I claim no responsibility for how you choose to use and modify it, and how it affects your system).

Remember, MozyHome offers 2 gigabytes of space free, and unlimited storage for $4.95 a month. I also get an extra gigabyte of space per user I refer, so please click on the link and sign up for this great service!

Monday, January 14, 2008

Backing Up

Anybody who's had more than a few years relationship with a computer knows the pain of a hard drive crash, and we all know that the pain resulting is directly proportional to how often you'd backed up in the past. I'm happy to say that just I've learned from my past mistakes, little by little, and each hard drive failure has been easier to deal with than the past.

In fact, I think I believe I'm going on almost two and a half years now without having to reformat my 400 mb primary hard drive (I've got a 100gb media hard drive that's going on 6 years now, I think, and I bought it used on eBay!). That being said, if something were to go wrong, I'd be set back at most a few weeks or a month.

Here are the various precautions I use to back up my data, in order of importance from most to least:

1) Windows Backup - it's included with every installation of Windows XP, and can be found in Start>Programs>Accessories>System Tools. If you can't find it there, you have to dig out your Windows XP disc and install it from there. Once installed, it has an easy to follow Wizard that asks you to specify which folders you want to back up. Restoration can be done from this wizard as well (I haven't had to restore anything, thank god, but as a result I can't give you first hand accounts of it). I personally choose to back the entire C: partition up (currently 80 gigs, up to 125 gigs when full) into my 500 gb Seagate external HD . Many of you may not have such disposable hard drive space, so pick and choose what you absolutely can't live without, mainly your My Documents folder.

I decided to go for the whole partition because I do have that space, and should the unthinkable happen it'll be completely painless to restore everything. And since I've done so many tweaks to my system that I can't even remember most of them (though I'm trying to for this blog), being able to pick up where I left off would be most ideal. I sincerely doubt I'd be building a new PC after this one anyway in the foreseeable future.

Finally, I decided to go with Windows Backup as opposed to a third party backup solution because it's built right into Windows, and was very user friendly from the get-go.

2) Mozy Backup - I'd already gone over this in an earlier post, but it bears repeating. Mozy is an online backup space that offers 2 gigabytes free for their personal license. Just sign up for an account, install their application, specify what folders/filetypes to back up, and set it and forget it. You can tell it to back up automatically on a schedule daily, even specify how much network and CPU bandwidth for it to use. 2 gigabytes isn't much, but it's enough for me to back up my emails to another source, as well as critical documents like accounting information and instant messenger logs. Also, every person you refer to use Mozy gets a free gigabyte of space! (coughpromotioncough)

3) Manual backup of work - I manually back up my current and past projects into another partition of my external drive. My external drive actually isn't big enough to fit all my old projects and current ones, so I prefer to have more control over what goes in and what doesn't.

4) DVD backups - I do this myself using Nero Express, and really only of projects that I've finished and need to archive for future reference. I don't do this very often anymore since getting my external HD, but it's always good to have another place for things to go, and DVD's are good especially if they're of projects long finished.

Finally, it's worth noting that for Windows Backup and Mozy Backup I've used Autohotkey and Windows scheduler to automate backup. I have Windows scheduler set up to run an Autohotkey script at 1:30 in the morning as long as the computer's been idle for at least an hour. Said Autohotkey script is my so-called "Hibernate" process, which among other tasks that I'll cover in a future post, runs Mozy backup, then detects whether my external drive is connected (it isn't always, as it sits at the office most of the time), and if so, runs Windows Backup. At the end the script puts my computer on Standby. I hope to elaborate more on this in the future, but for now I feel very good knowing that at most I'd only be a week or two set back in case of an emergency!

Tuesday, January 8, 2008

Thunderbird, Firefox, and Backups, October 10, 2007

Continuing from excerpts taken out of my "private journals" written back in October of 2007.

On the internet side of things, I've started taking advantage of Mozy, a free online backup tool that gives you 2 gigabytes and a program that automatically backs up certain file types and folders you specify. I'm not a huge fan of adding more background running programs, since I was already running google desktop, but I couldn't think of any other way to make sure the backups are made... I think I'd just forget. I might learn Windows Scheduler if I can use that somehow, but for the moment I need to start referring friends to it so I can get the free gig per referral.

With my being given a huge external hard drive for backups by [the production], hopefully the inevitable hard drive crash won't be nearly as overwhelming now, although there is a lot more data at stake the next time it happens.

On a related note, I researched remote desktop utilities on the hope that should I forget stuff at home, I can always connect to my home computer and look it up. Unfortunately for the moment I wasn't able to find a full featured freeware option that was also secure enough right out of the (digital) box. I'll have to shelf this idea for the moment until I can find the time to devote to it.

For Firefox, as with the others, it was all about tweaking the most performance out of it, uncluttering the desktop as much as possible, and using extensions that take those extra windows and mouseclicks down. I was also able to find a program that made backups of my extensions and tweaks, as by this point I'd made so many changes to the program that I wouldn't remember how to restore it in case I have to start over.

One extension [Searchwords] involved adding keyboard shortcuts as substitutes for using the search window. Now I can just install a search engine, give it a code letter like "g" for google or "y" for youtube, and just type "y jurassic park" into the address bar and it searches youtube for jurassic park clips. This took down the number of input bars on Firefox from 3 to 1, and gave it so much more room.

Online wise, I've started using iGoogle, which is a customizable home page portal where I was able to get notifications and previews of my email and yahoo mail, weather, and other gadgets like dontbreakthechain and a calendar.

(editor's note: Dontbreakthechain is the web application I used to keep track of my exercises and other daily routines, like making my bed)

Most importantly, though I was also about to put an RSS reader into the igoogle page, namely Google Reader. Now I'm able to keep up to date on all my favorite blogs in one place, saving me having to do a lot of typing and clicking. I'm excited whenever I get to bookmark yet another interesting blog, knowing that I'll never forget to check it in the future.

Thunderbird went through the same treatment of extensions and consolidation and purging of unnecessary buttons. Most importantly, though, I finally went super nuts on putting everything into categorized folders. I'd done this to my laptop back when I was in Jersey but importing the organization into my desktop did not handle very well. I still need to reinstitute all the filters I had to put them all in the right folders, along with probably having to create folders for the "Sent" folder as well.

Finally, I've started using Autohotkey, a batch process program to let me open and close multiple programs in one doubleclick. Eventually I'd like to learn to write batch programs myself, but for now this is an excellent choice.
The preceeding wasn't changed much from the original entry back in October, other than adding links to the respective applications. As such, many of these tweaks have become obsolete (upgraded or removed altogether).

Don't fret though, cause I plan on catching up real soon. I just wanted to really let you in on the process by which I got to my present configuration.