0

Morning All,

We're currently running some software for our users which is failing to copy their PST's on to our servers, it's too intrusive, requires client side software and configuration and its paid for!

I'm used to free/open source software and love command line batch files compared, as I find them easier to automate and also add to scheduled tasks without worrying about users input.

I have found hobocopy which works great! - but only if you list : source folder, dest folder and then file type... my script searches the C:\ drive, finds PST files and lists the full file path. Hobocopy doesn't seem to handle this.

Below is my script:

@echo off

REM ### COPY HOBOCOPY TO WINDOWS DIR #####

if not exist C:\windows\Hobocopy.exe xcopy \\icao-supp-01\support\hobocopy\hobocopy.exe C:\windows

REM ### SCAN SYSTEM FOR LOCAL PST FILES ####

dir *.pst /s /b  > C:\temp\pst.txt

REM ### RUN HOBOCOPY TO COPY PST FILES ####

For /f %f in (C:\temp\pst.txt) do hobocopy /y %f P:\

**HERE IS THE OUTPUT OF C:\TEMP\PST.TXT

C:\Jdeane.pst

C:\Games\IGNORE1.pst

C:\Windows\ModemLogs\fake2.pst**

It wont copy the file paths e.g. : hobocopy /y C:\Jdeane.pst P: wont work. However, hobocopy /y C:\ P:\ *.pst would work.

My goal: Search the C:\ drive for PST files and then have them backed up on a schedule to the servers.

Thanks in advance! (PS. Were running Windows 7 x64 and outlook 2010 if it makes a difference, and the users will NOT save their PST's to our servers).

James
  • 1
  • 2
  • It wants the directory and file name as separate arguments. Lose the list file and use /recursive from C:\ ? – Alex K. Jun 04 '14 at 17:33
  • You can't copy a PST file that is in use - at worst it will be corrupted by changes while copying. How do you ensure that Outlook is closed? – foxidrive Jun 04 '14 at 17:34
  • Actually, it is quite possible to copy files that are in use. Hobocopy uses the Volume Shadow Service, which includes hooks to notify programs that a backup is under way, and gives them an opportunity to write their data to disk in a consistent way. I'm not sure whether Outlook participates in that protocol, but at worst you're left with a file in the same state it would be if Outlook crashed suddenly - which often is better than having nothing at all. – Craig Andera Jun 05 '14 at 12:37
  • Yes you are right, volume shadow copy works and is the only way to backup a live system. I didn't google hobocopy. – foxidrive Jun 05 '14 at 15:12

1 Answers1

1

I'm the author of hobocopy. It is written to expect source folder, destination folder, and a file selector. So you're not going to be able to use a full path. That said, you can use the flags that can be found by running "help for" at the command prompt to break apart the path you find into directory and file components. Something like %~nf in your case, I believe.

Craig Andera
  • 401
  • 4
  • 3