Drive Snapshot

Discussion in 'backup, imaging & disk mgmt' started by Hadron, Nov 11, 2019.

  1. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    So, I can add hour, minute and second to my SNA backup files?
     
  2. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    Sure. I haven't tried it.
     
  3. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    I am trying it now, but for some reason, it has ignored $disk.
    The rest is working.

    It has popped up 2 command prompts. One is blank.
    And the command prompt windows are not starting minimized.
     
  4. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    I'll try it too.
     
  5. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Here is what I added to my previously posted script.

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 --UseVSS
    exit
     
  6. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    I was wrong about $disk. It does show.
    It has never shown HD1 on of the SNA files for some reason. I was looking at that one.

    But I don't know why I am getting 2 command prompt windows.
    The old script just displays 1, and it is minimized.
     
  7. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    I used "your" script (3 partitions on SSD) and all was OK. Only one minimized command window. Did you run the script as Admin?

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD3:* "E:\ds\$DISK-$DATE-$hour-$minute-$second.sna" -o -L0 --UseVSS
    exit
    One of my images was...

    H-191229-11-52-15.sna
     
  8. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    I get 2 command windows if I double click the batch file. Only one window if I Run as Admin.
     
  9. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    No. I'll run again as Admin.
    I have my other script running on a schedule with highest privileges.
     
  10. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    That's it. It's working as I expected. :thumb:
    Thanks, Brian.
     
  11. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    My MSR image is...

    HD3-1-191229-11-52-15.sna
     
  12. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    Great. I just found snapshot64.exe /? recently and knew "it was for you".
     
  13. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Yes. I remember asking you about adding a timestamp a while back.
    The website doesn't list them all.
     
  14. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    How do you access the Advanced Options GUI?

    Snapshot - Advanced Options.png

    Edit: I found it by using the GUI backup procedure.
     
  15. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    As a test I manually backed up a test UEFI system with DS.
    DS HD1 (a SSD) contained 7 partitions. This was Disk 0 in Windows Disk Management..

    MSR 16 MiB
    ESP 400 MiB
    Win10 20000 MiB
    RE 828 MiB
    Win 7 20000 MiB
    IFL 150 MiB
    Linux Mint 19.2 12000 MiB

    The ESP contained BIU (BootIt UEFI) which booted the four OS.

    7 .sna images were created.

    The SSD was wiped with Linux Discard, Unsecure Trim. All partitions were seen to be deleted and the SSD was entirely Free Space.


    A manual DS restore was performed from a WinPE.
    Selected "Restore complete Disk from Images"
    Browsed to the images. You can choose any of the 7 images. Now all 7 images appear in DS "Select the image file".
    Disk to restore to... HD1
    Leave tick in "Restore the partition structure"
    Continued on
    Success
    Restore time was 7:11 (min:sec).
    Win10 booted normally
    BIU needed to be manually reinstalled and all OS booted.


    An IFL restore takes 1:52 and BIU doesn't need to be manually reinstalled. IFL is fast.
     
  16. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    DS hasn't failed me yet. And it's so light. Good German quality.

    If only some smart person could find a way to purge old backups like Reflect and Image For Windows IFWRotate does.
    It would save me monitoring and manually deleting backups on the wife's computer.
     
    Last edited: Dec 29, 2019
  17. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    This works. It saves the 3 most recent images but this can be edited...

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD3:* "D:\ds\$DISK-$DATE-$hour-$minute-$second.sna" -o -L0 -R --UseVSS -W
    MD hadron
    MOVE *.sna hadron
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN hadron Entire-1
    
    Entire-1 contains the most recent image.
     
  18. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Thanks, Brian.
    I'll test to see exactly what it does now.

    I see that you also have -R and -W.
    I know -R empties the Recycle Bin and -W suppresses <Hit Any Key> if started from Scheduler.
    I have never had to suppress <Hit Any Key> if started when Scheduler.
     
  19. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    Hadron, I haven't had to use -W before but after the snapshot64 line ran I saw <Hit Any Key>.
    I don't know why.

    I can make a backup in just over 10 seconds as I'm imaging empty partitions. So I can run these tests quickly and I like this script.

    How many DS images would you like the script to keep?
     
  20. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    I understand why you used the -W now. It's could for me to see that backup was a success.

    I have finished testing, but it didn't make directories, move or rename anything. It just created a backup as usual.
    Where in the script does it delete old backups?

    I think maybe 5 backups would be good.
     
  21. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    Can I see your script?
     
  22. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    This works for 5 backups...

    Code:
    IF EXIST Entire-5 (RD Entire-5 /s /q)
    IF EXIST Entire-4 (REN Entire-4 Entire-5)
    IF EXIST Entire-3 (REN Entire-3 Entire-4)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN hadron Entire-1
     
  23. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    The only thing I changed was replace hadron with Backup.

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\$disk-$date-$hour-$minute-$second.sna" -o -L0 --UseVSS
    MD Backup
    MOVE *.sna Backup
    IF EXIST Entire-3 (RD Entire-3 /s /q)
    IF EXIST Entire-2 (REN Entire-2 Entire-3)
    IF EXIST Entire-1 (REN Entire-1 Entire-2)
    REN Backup Entire-1
     
  24. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,176
    Location:
    NSW, Australia
    Do you see <Hit Any Key>?
     
  25. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,145
    Yes, I see that at the end.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.