Practical Joke Turns Into Lesson Learned
When I returned to work this morning after my excellent getaway I learned of a power outage on Friday afternoon that took down the desktops in the Systems Administration area. Oh great!
When I logged into my machine, the login screen was different and then all of my files were missing. Oh no, my profile is hosed. No wait, there are no files under a previous profile. Oh crap!
After getting thoroughly pissed off that my day would be filled with installing software and recreating my machine, a sinking reality set it. I have a bunch of project files on my desktop that have not been saved to my share drive. I know better, but sometimes we don’t always take heed to our own best advice. Today, I thought was a good day to correct that.
The practical joke was that my buddies switched out the hard drive so no files were lost. This time!
I found a PowerShell Script to Backup Files Using Windows PowerShell and set it to backup my desktop to share drive automagically using task scheduler. I’m still testing it to see if it is the script to do what I need it to do. I could write one myself, but I am a PowerShell newbie and why reinvent the wheel.
Enjoy!
[Edited:]
The script above did not work out too well as it did not copy over folders. I created a simple script with the following line:
-
Copy-Item c:\Users\ewatson\desktop s:\ -recurse
That did the trick!
Posted on April 16, 2012, in Lessons Learned and tagged Backup and Recovery, PowerShell. Bookmark the permalink. 1 Comment.
FYI, you can have OneDrive automatically backup your Desktop, Documents, and Pictures