My retention periods are as follows:
Daily VMs: These VMs are servers that have data that changes often. Examples include File servers, SQL Servers, and Mail Servers. I keep four restore points, and these jobs run on M, T, W, and Th. The jobs are daisy-chained using a Powershell script like this:
Add-PsSnapIn VeeamPSSnapIn
get-vbrjob -name "Daily-Web" | start-vbrjob
Upon completion of the last job, the files that compose the Veeam backup job are copied over a WAN link using robocopy to a NAS that I recently acquired. I'm very happy with the NAS! It's an Iomega StorCenter px6-300d that I bought with no drives for $900. Then I bought 6 3TB SATA disks for another $900 or so and arranged them in RAID5. I have around 14TB in usable space for less than 2 grand!!!
Weekly VMs: These are application servers that very rarely change, like terminal servers and print servers. The weekly job also includes all VMs in my "Daily-VM" jobs, so I can save one copy of them every week. This allows me to have grandfather-father-son retention. I save 4 restore points for all of these VMs, and after the job runs I copy the files offsite to the NAS. The challenging part I ran into was working a way for my script to detect that it was the last Friday of the month, and then start the Backup Exec job to also write the Veeam backup files to tape. My first search turned up this Powershell function created by PoSH Pete called LastXofMonth. I whittled the script down, because I only need to find the last friday, and came up with this:
#Get the date of the last Friday of this month
$Dayname = "Friday"
$LastDayOfMonth = (Get-Date -Year (Get-Date).Year -Month (Get-Date).Month -Day 1).AddMonths(1).AddDays(-1)
If($LastDayOfMonth.DayOfWeek -eq $DayName)
{
$Answer = $LastDayOfMonth
} #End If
Else {
While($Answer -eq $Null)
{
$LastDayOfMonth = $LastDayOfMonth.AddDays(-1)
If($LastDayOfMonth.DayOfWeek -eq $DayName)
{
$Answer = $LastDayOfMonth
} #End If
}#End While
}#End Else
#Get Today's date and do some date formatting
$Date = ((get-date).ToShortDateString())
$LastFriday = ($Answer.date)
#If Today's date is past or equal to the date of the last friday, start the BE job that writes monthly Veeam backups to tape
If ($Date -ge $LastFriday){
start-process "C:\Program Files\Symantec\Backup Exec\bemcmd.exe" -ArgumentList '-o1 -jCITYBU01 - Veeam to Tape'
} #End If
Something I have forced myself to do with my scripts is to put comments at the end of any command blocks, like If, Else, While, etc. Anywhere that there's code within a set of curly braces that spans more than one line gets a comment. It make nested conditional statements much better to trace out and troubleshoot.
One nice thing I discovered when working with datetime datatypes in this script is that if you take two dates you can compare them. Well, I didn't discover it; it makes sense. I had never done it before and was pleasantly surprised that it worked like I thought it should.
[datetime]$date1 = "11/1/2012"
$date2 = ((get-date).ToShortDateString())
$date1 -gt $date 2
This evaluates as true, because November 1 is "greater than today, which is 10/22/2012.
Click an Ad
If you find this blog helpful, please support me by clicking an ad!
Monday, October 22, 2012
Sunday, October 21, 2012
I Rooted my Phone and Found Some Great New Apps
So if you read my post from Saturday, I watched the guy next to me use an app called DroidSheep to hijack someone's Facebook connection. So far, I've avoided rooting my phone because it just works. BUT, this app got me to wondering what other apps were out there that would make things work better if only my phone was rooted. So, I rooted my phone. Besides the aforementioned DroidSheep app, I also downloaded and installed:
I also bought and installed Tasker and Locale, which will make my life MUCH easier by automating things (too bad this thing doesn't run Powershell amiright?). I've missed too many calls because my phone was left on the silent setting, and I can set it to put my phone in airplane mode when I go to the movies. Locale deals with these issues. Tasker looks dead useful, and there's a whole list of things from their wiki that I want to try.
Some more amazing apps I stumbled upon are:
SwipePad (Gesture driven pop-up menus - Just try it, I've been looking for something like this for a looooong time)
Multicon (let's you put four icons in a widget in the space of one icon)
Aaaand I'm also on LauncherPro, having moved from Holo Launcher. To make my home screens less busy, I've removed text labels from all of the icons on my home screen, which is taking some getting used to.
- ShootMe (take screenshots just by shaking your phone)
- Titanium Backup Root w/ Pro key (it backs up to DropBox, holy crap!). There's a how-to on Lifehacker for setting up Titanium to properly protect your phone here. It's a little dated now, but a little adaptation seems to have done the trick.
- AdFree (redirects app requests to a curated list of IPs to 127.0.0.1)
I also bought and installed Tasker and Locale, which will make my life MUCH easier by automating things (too bad this thing doesn't run Powershell amiright?). I've missed too many calls because my phone was left on the silent setting, and I can set it to put my phone in airplane mode when I go to the movies. Locale deals with these issues. Tasker looks dead useful, and there's a whole list of things from their wiki that I want to try.
Some more amazing apps I stumbled upon are:
SwipePad (Gesture driven pop-up menus - Just try it, I've been looking for something like this for a looooong time)
Multicon (let's you put four icons in a widget in the space of one icon)
Aaaand I'm also on LauncherPro, having moved from Holo Launcher. To make my home screens less busy, I've removed text labels from all of the icons on my home screen, which is taking some getting used to.
Saturday, October 20, 2012
SUMIT 2012 - Security at U of M IT
Yesterday was a lot of fun: I attended the SUMIT security conference at the University of Michigan. This is an annual conference, and every year I'm reinvigorated to learn more about security. The guy next to me was showing me Droidsheep on his Galaxy Tab, and successfully intercepted another attendee's Facebook connection over the open wireless. We made an innocuous post on his wall touting the conference.
Some interesting things I learned:
Some interesting things I learned:
- I NEED to start playing with the Backtrack Linux distro.
- I now have zero faith in the security of unencrypted files stored on computers that are connected to the internet. The hackers are too good, and too numerous. I wonder what will happen when no one can rely on proof of identity anymore? When everyone's identity is out there, how can any agreements be trusted that aren't made in person? I asked the group I was with that question, and they immediately said biometric devices, but that's just another digital system that can and will be manipulated.
- On your network, you should block any outgoing UDP traffic where the sender's address is not within your network (in other words, spoofed). Evidently, this act is considered just being a good netizen. This prevents many different kinds of attacks that use spoofed UDP packets from being perpetrated from your network.
- I never thought about it before, but I wonder what Google thinks of all of the insecure Android devices out in the public? Think about it: If you own an Android device (and you're not rooted) you don't get updates for Google's OS until your carrier releases them. I'm on Sprint and I've only had Ice Cream Sandwich for 2 months! I've now found a very wonderful reason to root my phone: security! Isn't that ironic?
- There was a presenter from the ACLU speaking about how easy and pervasive wiretapping is now. Cellphone companies track your every movement, sure. We all know this. But do you know how long the different companies keep your data? AT&T is the worst offender at 3 years. How many requests from law enforcement were made last year? Something like 1.5 million!
Thursday, October 18, 2012
Nice Stopwatch Tool (online or off)
I've been doing a lot of real-time based testing lately for some odd reason. How fast does this file open? How long does it take to transfer a gigabyte file to that server across this WAN link? I was using my phone at first, but I wanted a desktop option and found a great site called online-stopwatch.com. You can use their many different timers right through the webpage, or download them and run them locally.
Yeah I'm reaching (not to detract from the utility of the online-stopwatch!). I've been pretty much building virtual machines and scoping out performance requirements for a new SAN we'll hopefully be ordering in Q1 2013. Pretty boring stuff.
Yeah I'm reaching (not to detract from the utility of the online-stopwatch!). I've been pretty much building virtual machines and scoping out performance requirements for a new SAN we'll hopefully be ordering in Q1 2013. Pretty boring stuff.
Subscribe to:
Posts (Atom)