Drive Snapshot

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

  1. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Apologies for the piecemeal approach. This diff script works and the diffs can be restored. Right click the scripts and Run 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
    
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set timestamp=%time:~0,8%
    if @%timestamp:~0,1% == @ set timestamp=0%timestamp:~1,7%
    set timestamp=%date:.=%_%timestamp::=%
    echo.Timestamp :: %timestamp%
    
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff-%timestamp%.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    
    
     
  2. paulderdash

    paulderdash Registered Member

    Joined:
    Dec 27, 2013
    Posts:
    4,644
    Location:
    Under a bushel ...
    Brian - being a total noob to all this, and just to be clear ...

    Is the full script still as per post #122?

    And would one then run a Full followed by 'n' no. of Differentials (above)?

    I would preferably want to run these via Windows Task Scheduler ...
     
  3. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Same here. Or simply add to my now antique but still relevant Solways Task Scheduler. https://www.wilderssecurity.com/threads/solways-task-scheduler.208888/

    @Brian K - Please elaborate if you will for the percentage symbols such as.....

    Assuming those points of time are random as an exmple
     
  4. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    I am getting an error.
    The system cannot find the specified path.
    It's not finding the .hsh hash file. I don't think it is even creating the hash file.
    I am running it as Admin.

    Code:
    06:21:15 Start of Snapshot 1.48.18810 [Jun 10 2020] at 14/07/2020
    06:21:15 Running on Windows 10 Professional 64-bit  (19041)
    06:21:15 Memory Info: Total: 65237Mb, Free: 55366Mb, Pagefile total: 74965Mb, Pagefile free: 61675Mb
    06:21:15 Command line: snapshot64.exe  HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff-Tue 14/07/2020_062115.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    06:21:15 ***********************************************************
    06:21:15 Snapshot error HashFileUtils, line 1109
    06:21:15 Error opening hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh.
    06:21:15 last Windows Error: 2-The system cannot find the file specified.
    06:21:15 ***********************************************************
    06:21:15 ***********************************************************
    06:21:15 Snapshot error NTCOPY, line 2277
    06:21:15 can't open hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh
    06:21:15 last Windows Error: 2-The system cannot find the file specified.
    06:21:15 ***********************************************************
    06:21:15 Error occurred - exitcode 22
    Differential Backup
     
    Last edited: Jul 13, 2020
  5. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Hadron, there is a space in your timestamp...

    Tue 14/07/2020_062115

    I don't know how that happened. In Region, Formats, Additional settings, Date tab. My short date is...

    yyyy-MMM-dd

    Anything with - is acceptable. You have / which won't work.

    Here is what my Entire-1 folder contains. GPT disk. Four empty partitions. Only one partition with a drive letter.

    backups.png
     
  6. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Paul, the full in #122 is fine.
    The diffs in #122 and #126 are fine. I recommend #126.
    The disadvantage of the first diff is you have to copy or move files from a sub-folder into the main folder prior to a restore.
     
  7. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    EASTER,

    % or %% in batch files are Variables. If you have trouble sleeping, check out "Variables in batch files" in Google.

    Try this. Create a new folder. Put this batch file in the folder...

    Code:
    @echo off
    CD /d %~dp0
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set timestamp=%time:~0,8%
    if @%timestamp:~0,1% == @ set timestamp=0%timestamp:~1,7%
    set timestamp=%date:.=%_%timestamp::=%
    echo.Timestamp :: %timestamp%
    MD %timestamp% 
    Double click or Run as Admin. It will created a date-time folder.
     
  8. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Hadron,

    If you don't like the changed date format you could use this...

    Code:
    @echo off
    CD /d %~dp0
    if not defined RunTask set RunTask=1 & start "Snapshot" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
    
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set timestamp=%time:~0,8%
    if @%timestamp:~0,1% == @ set timestamp=0%timestamp:~1,7%
    set timestamp=%timestamp::=%
    echo.Timestamp :: %timestamp%
    
    snapshot64.exe HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff-%timestamp%.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
     
  9. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    Still not working.
    Code:
    08:20:01 Start of Snapshot 1.48.18810 [Jun 10 2020] at 14/07/2020
    08:20:01 Running on Windows 10 Professional 64-bit  (19041)
    08:20:01 Memory Info: Total: 65237Mb, Free: 55040Mb, Pagefile total: 74965Mb, Pagefile free: 61194Mb
    08:20:01 Command line: snapshot64.exe  HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff-082001.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    08:20:01 ***********************************************************
    08:20:01 Snapshot error HashFileUtils, line 1109
    08:20:01 Error opening hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh.
    08:20:01 last Windows Error: 2-The system cannot find the file specified.
    08:20:01 ***********************************************************
    08:20:01 ***********************************************************
    08:20:01 Snapshot error NTCOPY, line 2277
    08:20:01 can't open hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh
    08:20:01 last Windows Error: 2-The system cannot find the file specified.
    08:20:01 ***********************************************************
    08:20:01 Error occurred - exitcode 22
     
  10. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Hadron, try this as an experiment...

    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\Entire-1\$disk-diff.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    Your batch file readout is different from mine. I don't see
    08:20:01 Start of Snapshot 1.48.18810 [Jun 10 2020] at 14/07/2020
    08:20:01 Running on Windows 10 Professional 64-bit (19041)
    08:20:01 Memory Info: Total: 65237Mb, Free: 55040Mb, Pagefile total: 74965Mb, Pagefile free: 61194Mb
     
  11. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    This is the error I get with that.
    Code:
    08:53:11 Start of Snapshot 1.48.18810 [Jun 10 2020] at 14/07/2020
    08:53:11 Running on Windows 10 Professional 64-bit  (19041)
    08:53:11 Memory Info: Total: 65237Mb, Free: 56241Mb, Pagefile total: 74965Mb, Pagefile free: 63302Mb
    08:53:11 Command line: snapshot64.exe  HD1:* "D:\System_Backup\Drive_Snapshot\Entire-1\$disk-diff.sna" -h"D:\System_Backup\Drive_Snapshot\Entire-1\$disk.hsh" -R -L0 --UseVSS -W
    08:53:11 ***********************************************************
    08:53:11 Snapshot error HashFileUtils, line 1109
    08:53:11 Error opening hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh.
    08:53:11 last Windows Error: 2-The system cannot find the file specified.
    08:53:11 ***********************************************************
    08:53:11 ***********************************************************
    08:53:11 Snapshot error NTCOPY, line 2277
    08:53:11 can't open hash file D:\System_Backup\Drive_Snapshot\Entire-1\D.hsh
    08:53:11 last Windows Error: 2-The system cannot find the file specified.
    08:53:11 ***********************************************************
    08:53:11 Error occurred - exitcode 22
     
  12. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Can you look in D:\System_Backup\Drive_Snapshot\Entire-1

    Do you have .hsh files?
     
  13. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    No, Brian.
     
  14. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Ah, you need to run the full script before running the diff script.
     
  15. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    Oh, so it will be 2 separate scripts that I need to run.
    Which full one do I need to run first?
     
  16. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    The full in #122 first. Then any of the diff ones I posted. See which one you like best.

    Maybe after 10 or 20 diffs (depending on diff size) you would make another full.
     
  17. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Don't use the test diff in #135. It will keep over-writing the diff backup. That's why we need a variable in the diff filename.
     
  18. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    If I don't change the date format, I will have to use #133. Correct?
     
  19. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    A Windows copying screen flashed up.
     
  20. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    When we are making diffs, we don't need five "Entire" folders. 2 or 3 is probably enough.
     
  21. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,184
    Location:
    NSW, Australia
    Correct. It doesn't use %date%.
     
  22. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    Percentage is stuck on 0% even though it is reading and writing.
     
  23. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
  24. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    I know what that Windows flash was. It cleared the Recycle Bin.
    I might turn that off for future backups.
     
  25. Hadron

    Hadron Registered Member

    Joined:
    Apr 1, 2014
    Posts:
    2,150
    It is very slow. Only at 1%.
    I don't know what is happening.
     
  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.