Menu

Script to capture image remotely

amtech
2013-08-07
2014-07-02
  • amtech

    amtech - 2013-08-07

    Hi,

    I have made a script to capture image of drives on remote computers.
    This works very nicely but I noticed that compression is either gzip or
    bzip.
    I ran both and it seems they are the same.
    I also noticed that the GUI tool has BZip2, not bzip. Is that by design or
    just an oversight?

    Love your program!
    please keep up the great work1

    Here's my script in case anyone is interested....


    @echo off

    rem Read a list of computers and run odin backup on those computers

    set strdate=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%

    for /f %%a in ('type "c:\computers.txt"') DO (

    IF Not EXIST "\backup\E$\images\%%a" (
    mkdir "\backup\E$\images\%%a"

    PSEXEC "\%%a" -u domain\administrator -p Password -c -f -h odin.exe
    -makeSnapshot -backup -compression=gzip -source=1
    -target=\backup\E$\images\%%a\%%a-Cdrive-%strdate%.img

    PSEXEC "\%%a" -u domain\administrator -p Password -c -f -h odin.exe
    -makeSnapshot -backup -compression=gzip -source=2
    -target=\backup\E$\images\%%a\%%a-Ddrive-%strdate%.img

    )

    )

    cmd


     
    • Justin Goldberg

      Justin Goldberg - 2013-08-08

      Nice script.

      There is no bzip compressor afaik. If there is, it was a predecessor to the
      bzip2 format.
      On Aug 7, 2013 7:20 PM, "amtech" amertech@users.sf.net wrote:

      Hi,

      I have made a script to capture image of drives on remote computers.
      This works very nicely but I noticed that compression is either gzip or
      bzip.
      I ran both and it seems they are the same.
      I also noticed that the GUI tool has BZip2, not bzip. Is that by design or
      just an oversight?

      Love your program!
      please keep up the great work1

      Here's my script in case anyone is interested....

      @echo off

      rem Read a list of computers and run odin backup on those computers

      set strdate=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%

      for /f %%a in ('type "c:\computers.txt"') DO (

      IF Not EXIST "\backup\E$\images\%%a" (
      mkdir "\backup\E$\images\%%a"

      PSEXEC "\%%a" -u domain\administrator -p Password -c -f -h odin.exe
      -makeSnapshot -backup -compression=gzip -source=1
      -target=\backup\E$\images\%%a\%%a-Cdrive-%strdate%.img

      PSEXEC "\%%a" -u domain\administrator -p Password -c -f -h odin.exe
      -makeSnapshot -backup -compression=gzip -source=2
      -target=\backup\E$\images\%%a\%%a-Ddrive-%strdate%.img

      )

      )

      cmd


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/odin-win/discussion/748470/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • amtech

    amtech - 2014-07-02

    Though I'd tweak on the script abit
    Not sure if all the back slashes will show up

    Note: The computer list doesn't use back slashes so ping will work
    Note: \\backup is a server so, it should have two back slashes in front of it
    Note: The \\%%a after PSEXEC has two back slashes
    
    ----------------------------------------------------------------------------
    
    @echo off
    
    Rem Read a list of computers and run odin backup on those computers
    
    set strdate=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%
    
    for /f %%a in ('type "c:\computers.txt"') DO (
    
    Rem see if the computer is online
    ping -n 1 %%a | find "Reply from " >NUL
    
       IF NOT ERRORLEVEL 1 (
    
          Rem create a folder if it's not already there
          IF Not EXIST "\\backup\E$\images\%%a" ( mkdir "\\backup\E$\images\%%a" )
    
    Rem image the complete drive
    PSEXEC "\\%%a" -u domain\administrator -p Password -c -f -h odin.exe
    -makeSnapshot -backup -compression=gzip -source=0
    -target=\\backup\E$\images\%%a\%%a-Cdrive-%strdate%.img
    
      Rem image the first partition
      Rem PSEXEC "\\%%a" -u domain\administrator -p Password -c -f -h odin.exe
      Rem -makeSnapshot -backup -compression=gzip -source=1
      Rem -target=\\backup\E$\images\%%a\%%a-Cdrive-%strdate%.img
    
      Rem image the second partition
      Rem PSEXEC "\\%%a" -u domain\administrator -p Password -c -f -h odin.exe
      Rem -makeSnapshot -backup -compression=gzip -source=2
      Rem -target=\\backup\E$\images\%%a\%%a-Ddrive-%strdate%.img
    
       )
    
    )
    
    cmd
    
     

Log in to post a comment.