Powershell to Robocopy files (say, to back up your computer to protect against CryptoWall trojan)

We were having a good time on DBAs@Midnight, when Sean got a weird pop up message that said all his files were encrypted, and he has to pay a large amount of money via Bitcoin to get the encryption key. The show quickly ground to a halt as he, then he and Freddie, then all three of us PLUS the chatroom, looked into what this was, how to stop it, what to do, and so on.

In short: Sean lost just about everything. He lost most of what he has on his computer. He lost all the important files that he’d made sure were copied offsite to OneDrive – CryptoWall encrypted those too. (You might want to wait a few weeks before mentioning it in his presence, seriously.)

The funny thing is, we’re data professionals, and we thought we were reasonably well covered for backup. Okay, OneDrive isn’t perfect/ideal, but we neglected to imagine the scenario that didn’t just affect one computer, or one home network, but also spread to The Cloud of Awesomeness.

It’s not the final solution, but…

You’re going to want to get yourself something like Carbonite Cloud Backup (though I wonder, if you have the constant update turned on, whether this would be an advantage against the CryptoWall encryption…probably ONLY if Carbonite keeps file versions).

AND you’re going to want to do regular (say, monthly or so) backups to an external hard drive. I have my Documents folder, my Dropbox folder, and several folders on the root, and even with Robocopy (it comes with Windows!), I found it a little bit of a pain to copy specific things over. So, Powershell!

This script – RobocopyToDest.txt* – lets you define a source, destination, and exclusions (e.g., “don’t copy over the XYZ folder”) to copy a set of directories. It’s a rough cut, I-just-made-this script, but I rant it and it works beautifully. Take it and adjust to your own needs, and for heaven’s sake back up your files!

 *Save RobocopyToDest.txt with a .PS1 file extension. WordPress doesn’t like saving script files, and I don’t like zipping up tiny text files. 

Read up on this stuff

5 thoughts on “Powershell to Robocopy files (say, to back up your computer to protect against CryptoWall trojan)

  1. Pingback: You have computer files you want to keep, so read on | Jen's Blog: We Owls

  2. Pingback: С миру по нитке, №22 | Things I think about

  3. george renee

    Use a batch file with robocopy to mirror your permanent backup drive to the rotated drives for off site storage. As a result you always have a few backups ready and waiting on the Veeam server, but you also have off site backups in case of DR.

    Something I quickly found out as I sometimes have non-technical folk trained to swap the removable drives is that they will do it regardless of whether the robocopy job is complete. Solution? Send them an email when it is safe to swap the drives. The result is a batch file and a powershell script. Install robocopy and powershell on your Veeam server. Run the batch file after your backup runs…..I used robocopy in past but this tool has some major issues…currently i am using gs richcopy 360 enterprise for these type of work.

Comments are closed.