Robocopy Notes

Install cmder: It’s the nicest shell I’ve seen for windows. Run your console as Administrator. Otherwise you can’t use the /B backup switch. Also rember you need to do a net use command as administrator.

Before you robocopy stuff, setup a dedicated drive letter. The drive letter is only available to the logged in session. So if you have drive p: for Bob, and then you boost your console to Administrator–no more drive p: ! So dont use the users drive mappings: create admin drive mappings.

net use p: \\nas02\backup\ "secret" /user:bob /persistent:yes

Remember to type the password with “double quotes” and not ‘single quotes’. If you type single quotes you may as well be typing capital Xes: they become part of your password.

The net use command to see if you already have a drive share. Close any File Explorer windows open to that server becuase that’s equivalent of have a net use $d /user:anonymous open at the same time, and windows wont cooperate. Mount the directory

There are a lot of switches. We’ll assume a C:\Users directory.

C:\Users\bob> mkdir c:\temp
C:\Users\bob> cd C:\Users
C:\Users> robocopy bob P:\bu-bob\ /mir /ZB /FFT /XA:SH /W:5 /R:2 /dcopy:T ^
 /XJ /XD "Temp*" "cache2" "temporary internet files" "*cache*" /NFL

First try the command without the /LOG switch. The command goes faster with the LOG turned on, do that later. /XF is a pattern to exclude files. Example log option: /LOG:C:\temp\bu.txt. The /NFL will show directories. not files.

The /MT flag is useful, but it prohibits logging, not available on Vista. The /XJ flag should be default, but sadly–no. Juntion points create these really frustrating backup path loops. Use /XJ!

Advertisements

Windows OEM License

liftarn_Big_brickSo it turns out you can destroy a windows virtual host really quickly, just by moving it from one host system to another host.

This is something I’ve done with Linux virtual hosts many times, and it seems like an intrinsic way to manage resources.

But not with Windows. They really expect you to take the time to install and configure all your applications again if the motherboard changes. It must not be possible to do live migration of windows virtual hosts.

SourceForge is making Open Source Look Like a Scam

Not only when I download something from SourceForge these days am I presented a proxy-downloader that tries to sell me on installing some unsolicited system utility — like a browser home page take over — it manages to install some other bullshit system utilities as well. Holy shit. This is not the Sourceforge I used to use. It is seriously WASTING MY TIME and making me HATE free (as in beer) software on Windows! Can’t they tell how much they are pissing in the well?

All I wanted to do was install Filezilla. Now I have crap to uninstall as well. Who at OSDL or FSDL or knumbskull.com do I have to strangle to stop this?

Update: Malwarebytes just popped up and said it blocked some malware. It started scanning and found four new bits of badness on my filesystem and asked me to reboot. Sure.

Translating Filenames — Bash Voodoo Style #linux

This is an example of using Bash to convert a crazy apache log and translating the filename into an IIS log pattern:

d=`date +%Y%m%d`
find k -type f \
| while read filename
do
  nextfile="${filename/k\/done?0.www\./k2/www-Server_T${d}_}.log"
  echo "$nextfile"
  cat $filename | $translate > "$nextfile"
done

I love how I can refer to a shell variable ($d) inside a string translation (${d}).

Remember “In the Trenches”? That’s How I Learned of LOPSA #lfnw

I chatted with a few of the guys at the LOPSA booth and mentioned that I first learned about LOPSA by listening to Kevin Devin’s In the Trenches podcast. This Friends In Tech show was insightful, informative and inspiring in that it presented intelligent and professional discussion about the profession of system administration, not merely righteous badmouthing of L-users. It turned me on to the SOTY contest, for which I was nominated in 2008 2007 and received a T-shirt, even.

Tail the Latest Log File

I’m grateful for Cygwin. I wouldn’t know how to do this in cmd–though I should probably learn how to do it in PoSH.

find LogFiles/W3SVC1 -type f | xargs ls -1tr | tail -n1 | xargs tail -F

I need to make it an alias now….