Thanks to all of the sage advice I have received here to write the scripts that will automate my specific backup needs, I have been successful in backing up my complete PC system with Terabyte. Still on the trial package, I plan to purchase this software just after the first of the year! Since I struggled a bit to get where I am today, I would like to post my scripts here with the hope that it will be able to help others to help getting their backups going quicker and without fail.
I have three scripts (one for each hard drive I am backing up) that are triggered by a fourth script. The destination drive is my S: DRIVE, a conventional internal SATA drive mounted in an external USB 3 caddy.
The first script backs up a USB 3 flash drive permanently attached to my PC, entitled BBACKUPTOS:
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w9 /f:"S:\Backup-w9-B DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs
The second script backs up a conventional internal SATA data drive, entitled DBACKUPTOS.cmd:
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w1 /f:"S:\Backup-w1-D DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs
The third script backs up an SSD internal SATA data drive (my boot drive), entitled CBACKUPTOS.cmd:
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w2 /f:"S:\Backup-w2-C DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs /rb:8
Please note that CBACKUPTOS.cmd ends with /rb:8, which tells the PC to shut down after this script completes.
The script that commands the order that my hard drives are backed up is entitled BACKUPTOS.cmd:
CD /d %~dp0
call "BBACKUPTOS.cmd"
CD /d %~dp0
call "DBACKUPTOS.cmd"
CD /d %~dp0
call "CBACKUPTOS.cmd"
So if I run BACKUPTOS.cmd, my PC backs up B, D and C drives that order and then shuts down the PC. These are full image backups that use the ZSTD-Fast compression algorithm, are validated, and send me an email after each script completes (letting me know success or failure).
***CAVEAT*** I first tried backing up B, C and D, in that order, but for some reason my PC wanted to back up B, D and C, which caused the PC to shut down after the second backup! I don't know what caused the PC to disobey the command in the BACKUPTOS.cmd file, but when I changed the file back to where it is now it ran just fine.
Comments? Questions?
THANKS AGAIN TO EVERYOJNE THAT HELPED ME AUTOMATE MY BACKUPS USING TERABYTE!!
Backing Up Entire PC
Re: Backing Up Entire PC
As a caveat to my December 28, 2025 post above, this arrangement does not always go as planned...as I am confused about the correct way to write a script to automate multiple-drive Terabyte backups. I never was taught how to write such scripts, so I have been following examples and taken advice from users here who know how to write scripts, I have found that apparently the way I have written them causes the hard drives to be backed up either in or out of order from session-to-session. Here is an example of scripts that I have written to backup E:Drive, then backup F: Drive, and then have my PC shut off. All three scripts have been saved in my \Documents folder and the script to initiate the whole process has been copied as a shortcut to my Desktop. When I ran the script yesterday from my Desktop, F:Drive was the first to be backed up (even though I believe the script calls for E:Drive to be backed up first), and the script calls for my PC to be shut down after F:Drive is backed up. However, I wanted E:Drive to back up first! If I did not intervene, only F:Drive would have been backed up and my PC shut down!
Here are the scripts:
EBACKUPTOZ.CMD
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w2 /f:"Z:\Backup-w2-E DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs
FBACKUPTOZ.CMD
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w3 /f:"Z:\Backup-w3-F DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs /rb:8
BACKUPTOZ.CMD
CD /d %~dp0
call "EBACKUPTOZ.cmd"
CD /d %~dp0
call "FBACKUPTOZ.cmd"
So can anyone explain why this is not working according to my understanding? Did I enter something wrong in the script(s)? I have written similar such scripts for my B-C-D Drive backup routines, and these as well backup in a random fashion from session-to-session.
HELP!!
Thanks in advance!!
Here are the scripts:
EBACKUPTOZ.CMD
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w2 /f:"Z:\Backup-w2-E DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs
FBACKUPTOZ.CMD
start "" "C:\Program Files (x86)\TeraByte Drive Image Backup and Restore Suite\imagew64.exe" /wait /b /d:w3 /f:"Z:\Backup-w3-F DRIVE-$~YYYY$-$~MM$-$~DD$-$~HHMM$" /v /comp:22 /ckfs /rb:8
BACKUPTOZ.CMD
CD /d %~dp0
call "EBACKUPTOZ.cmd"
CD /d %~dp0
call "FBACKUPTOZ.cmd"
So can anyone explain why this is not working according to my understanding? Did I enter something wrong in the script(s)? I have written similar such scripts for my B-C-D Drive backup routines, and these as well backup in a random fashion from session-to-session.
HELP!!
Thanks in advance!!
-
TeraByte Support
- Posts: 4105
- Joined: Thu May 05, 2011 10:37 pm
Re: Backing Up Entire PC
add a delay after the first to ensure it starts first.
CD /d %~dp0
call "EBACKUPTOZ.cmd"
TIMEOUT /T 5
CD /d %~dp0
call "FBACKUPTOZ.cmd"
note that only works for two/first item. If you had more than that, you don't know which would go next, so you'd want to use "start /wait" so that the batch file pauses (just means a black command prompt box would remain on the screen).
CD /d %~dp0
call "EBACKUPTOZ.cmd"
TIMEOUT /T 5
CD /d %~dp0
call "FBACKUPTOZ.cmd"
note that only works for two/first item. If you had more than that, you don't know which would go next, so you'd want to use "start /wait" so that the batch file pauses (just means a black command prompt box would remain on the screen).
Re: Backing Up Entire PC
Insert a /wait parameter straight after the "" in the 'start' commands, i.e.
Start "" /wait …
This will ensure that the 'start' commands do not finish until the particular instance of IFW has completed.
Cheers
Start "" /wait …
This will ensure that the 'start' commands do not finish until the particular instance of IFW has completed.
Cheers
Re: Backing Up Entire PC
Thanks to the both of you! I have re-written a number of scripts to conform with your directives and am pleased to report that they apparently work. So not only have I now automated my E-F Drive backups, but also my B-C-D Drive Backups!! I will continue to use these scripts during my normal backup routines (every 2 weeks--the next one coming up is Wednesday) and report back if I have further questions/problems!