IFW Backup Batch Script by Tom Cole - 01-Mar-2024

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

IFW Backup Batch Script by Tom Cole - 01-Mar-2024

Post by TAC109 »

My approach with this package is to examine backing up from the other side
of the equation. Given that a certain amount of space is available to hold
the backup files, IFW_Backup attempts to use this space efficiently to hold
the largest number of backup files.

This package will automatically decide whether it should take a full backup
or a changes-only backup based on historical data kept in its control files.
As well, a full backup can be specified via parameter, or by program code
(using day of week or month, or after a set number of change-only backups
have been taken, etc).

Also, when the space available for backups becomes nearly full, the oldest
backups will be deleted automatically to make room for the new.

. Updated 10-Sep-2016 to vn 4.09 - see viewtopic.php?p=12517#p12517 for details.
. Updated 13-Sep-2016 to vn 4.10 - see viewtopic.php?p=12518#p12518 for details.
. Updated 13-Jan-2017 to vn 4.11 - see viewtopic.php?p=13132#p13132 for details.
. Updated 19-Mar-2017 - Dropbox download address works again.
. Updated 24-Apr-2017 to vn 4.12 - see viewtopic.php?p=13701#p13701 for details.
. Updated 28-Jan-2020 to vn 4.13 - see viewtopic.php?p=18238#p18238 for details.
. Updated 31-Jan-2020 to vn 4.14 - see viewtopic.php?p=18248#p18248 for details.
. Updated 14-Jan-2022 to vn 4.15 - see viewtopic.php?p=20847#p20847 for details.
. Updated 01-Mar-2022 to vn 4.16 - see viewtopic.php?p=21024#p21024 for details.
. Updated 07-Mar-2022 to vn 4.17 - see viewtopic.php?p=21024#p21024 for details.
. Updated 03-Aug-2022 to vn 4.17 - Fixed download link.
. Updated 21-Oct-2023 to vn 4.18 - see viewtopic.php?p=22913#p22913 for details.
. Updated 28-Feb-2024 to vn 4.19 - see viewtopic.php?p=23280#p23280 for details.
. Updated 01-Mar-2024 to vn 4.20 - see viewtopic.php?p=23288#p23288 for details.

Updated version is available at https://bit.ly/3T21jyO

Don't forget to unblock the downloaded .zip file before use.
(Display the zip file properties and tick or press 'Unblock' near the bottom of the 'General' tab. OK out.)

Please see the IFW_Backup_Read_Me_First.txt file in the downloaded
IFW_Backup.zip file for information on how to install the IFW_Backup package.

Screenshots below, and in the next post
.
Attachments
IFW_Backup_1R.png
IFW_Backup_1R.png (81.71 KiB) Viewed 17923 times
IFW_Backup_2R.PNG
IFW_Backup_2R.PNG (14.26 KiB) Viewed 17923 times
IFW_Backup_3R.png
IFW_Backup_3R.png (62.2 KiB) Viewed 17923 times
Last edited by TAC109 on Sat Mar 02, 2024 11:12 pm, edited 43 times in total.
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

Re: IFW Backup Batch Script by Tom Cole - 07-Mar-2022

Post by TAC109 »

IFW_Backup_4R.png
IFW_Backup_4R.png (17.21 KiB) Viewed 18073 times
IFW_Backup_5R.png
IFW_Backup_5R.png (33.22 KiB) Viewed 18019 times
IFW_Backup_67R.png
IFW_Backup_67R.png (92.47 KiB) Viewed 18019 times

Updated 10-Sep-2016 Vn 4.09 - Enhancements and bug fixes.

- The package has been adjusted to work with Image-for-Windows
version 3 (as well as version 2).

- The package has been enhanced to allow multiple copies to run
simultaneously, by implementing a simple, secure locking scheme
to ensure that updates to critical, shared control files occur
safely. (This facility is used by the next two enhancements.)

- Provided a facility to run concurrent backups from different
machines to the same backup drive or partition. Use of this
feature can reduce overall backup times. See the new 'set cms'
entry in the IFW_Env.cmd file.

- Within a TBWinPE/RE environment, added a feature which allows
simultaneous backups of several physical hard drives to a common
backup drive on the same machine. This can reduce the total
backup time for a computer. See the IFW_PeRe_Read_Me.txt file for
more information. (IFW_PeRe.cmd and some of the MyDefrag scripts
have been changed to support this feature.)

- Within a TBWinPE/RE environment, IFW_PeRe.cmd now sets the correct
'Temp' folders for later purging if required.

- Added alternative 'run after' entries ra4 & ra5 for Windows 8 and
above, to run a Windows Defender scan after a successful backup.
See these entries in the IFW_Env.cmd file for more information.

- Changed the default 'run after' entries ra4 & ra5 to not run under
a TBWinPE/RE environment, as this is not possible at present.

- Added an example 'set ray' run-after entry which can be used to
shut down or restart the computer after the backup has finished.
(This replaces the equivalent IFW 'power options' settings, which
must NOT be used.)

- Added the equivalent shut down/restart facility to IFW_PeRe.cmd
for use in a TBWinPE/RE environment. (See the IFW_PeRe_Read_Me
file for details.)

- If the display of 'set rb?' and 'set ra?' code is suppressed in
the screen window, it will also be suppressed from the log.

- Added the ability for run-after code to generate a 'warn' type
log. See the default 'set ra0' entry in the IFW_Env.cmd file.

- Changed the name of the 'early initialisation errors' log to
"IFW_Backup_Init_[computername]_[IFW_Env_name]_fail.log". It will
be created in the IFW_Backup folder if necessary, as before.

- Adjusted the 'Incorporate Old Backups' option to calculate the
minimum size of the first backup, when this option is used before
the first backup has been taken. Documentation on this has been
added to this section in the IFW_Backup_Read_Me_n.nn.txt file.

- IFW_Backup_Set_up_n.nn.exe should now add administrator rights to
shortcuts correctly when run on non-English versions of Windows,
and with Windows 10. (There may be pauses of up to 4 seconds
during this process.) If you encounter any problems with this,
please contact me at the email address under 'Warranty', or
post a message on the Terabyte Unlimited forums.

See the first post for download instructions.
Last edited by TAC109 on Mon Mar 07, 2022 3:27 am, edited 5 times in total.
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

Re: IFW Backup Batch Script by Tom Cole - Update 13-Sep-2016

Post by TAC109 »

Updated 13-Sep-2016 Vn 4.10 - Bug fix.

- Fixed calculation of minimum reserved space for other concurrently
running backups. This could be incorrect, especially when the
backup disk (partition) was formatted as FAT32.

- Added some information regarding this calculation to the 'set cms'
entry in the IFW_Env.cmd file.

See the first post for download instructions.
Somebeachsomewhere
Posts: 15
Joined: Sun Dec 04, 2011 11:29 pm

Re: IFW Backup Batch Script by Tom Cole - Updated 13-Sep-201

Post by Somebeachsomewhere »

Shared Network drive setup
Following is my setup. Running Windows 7 x64 on each computer.
Computer A connected directly to USB external drive (Note: not a NAS drive)
Computer B,C,D etc connected to LAN.
USB external drive is designated as drive letter Z:. It has the following folders that are shared on the LAN. Each computer has access to all other computers backup folders. (i.e. the set bak=) statement. For example Computer A has (set bak=Z:\Computer_A_folder\);Computer B has (set bak=Z:\Computer_B_folder\) etc. Backup space is shared. For computers not directly connected to the external USB drive (computers B,C,D etc)I have mapped the drive letter as above.
Under sharing backup space paragraph 6 it states
All computers using shared backup definitions must be able to access the IFW_Data folder pointed to by the 'set dat' entries and all must be able to access each other's backup folders defined in the 'set bak' entries.
No problem for the 'set bak' entries as I have sharing setup so each computer can "see" all the relevant backup folders.
However, what do I do with the IFW_Data folder so each computer can see it? I cannot map Z:\ as it is already used for the backup folders. I mapped Y:\ using an administrative share (i.e. Y$) for those computers not directly attached to the external USB drive.
Running IFW_Backup.cmd on Computer A works fine. It created the IFW_Data folder under root on Z:\. So I now had Z:\IFW_Data that I shared with all other computers not attached directly to the external USB drive, mapping it as Y:\ (from the administrative share Y$). Will this work? I tried mapping it as Y:\ to the folder Z:\IFW_Data but when I do that the IFW_Backup.cmd script creates a subfolder of this folder on each LAN computers' first script run. This results in a path of Z:\IFW_Data\IFW_Data.
I guess my question is how do I correctly map the IFW_Data folder for those computers not connected directly to the external USB drive connected to Computer "A"?
Incidentally, it would be nice to have an option to abort the shutdown (set ray= if not exist ^"X:\Windows\^" shutdown /s /t 60) command. I've made some errors running the script which quickly aborts and then the shutdown in 1 minute starts. I've taken as a temporary measure to have an administrators command prompt open with the command shutdown -a ready just in case.
Thanks for this program. Someday I'll get the hang of it.
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

Re: IFW Backup Batch Script by Tom Cole - Update 13-Sep-2016

Post by TAC109 »

Somebeachsomwhere and I discussed his problem via email and reached the conclusion that it was only necessary to map the USB disk root folder (Z:\) on the A computer to Z:\ on the B, C, etc computers, and this would make the underlying folder structure on the USB disk available to the B, C, etc computers without any extra mapping necessary.
Exciter
Posts: 2
Joined: Fri Jan 06, 2017 1:24 am

Re: IFW Backup Batch Script by Tom Cole - Update 13-Sep-2016

Post by Exciter »

I am unable to get this script to work. I don't quite understand the error here:

Microsoft Windows [Version 6.1.7601]

"C:\IFW_Backup\IFW_Backup.cmd" ?
Checking "C:\IFW_Backup\IFW_Env.cmd"...
Year not 4 characters!
Month not 2 characters!
Day not 2 characters!
yyyy-mm-dd@ [today's date]
17-01-05@
Check 'set year', 'set month' and 'set day' in IFW_Env file!
Run abandoned!

Help?
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

Re: IFW Backup Batch Script by Tom Cole - Update 13-Sep-2016

Post by TAC109 »

On Thu, 5 Jan 2017 17:33:14 PST, Exciter wrote:

>I am unable to get this script to work. I don't quite understand the error here:
>
>Microsoft Windows [Version 6.1.7601]
>
>"C:\IFW_Backup\IFW_Backup.cmd" ?
>Checking "C:\IFW_Backup\IFW_Env.cmd"...
>Year not 4 characters!
>Month not 2 characters!
>Day not 2 characters!
>yyyy-mm-dd@ [today's date]
>17-01-05@
>Check 'set year', 'set month' and 'set day' in IFW_Env file!
>Run abandoned!
>
>Help?

Hi Exciter

Thanks for trying out the package.

This error is occurring because the year in the date shown (17-01-05)
is expected to be 4 digits (i.e. 2017-01-05). (This error has offset
the month and day fields, causing the other knock-on errors.)

If you bring up a cmd prompt in Windows and type 'date' then 'enter'
(without the quotes), what is the output?

If it shows a 2 digit year, you will need to check your Region
settings in the Control Panel. Look at the Formats tab. The short date
should have the year as 'yyyy' (without the quotes) in a standard
setup.

Could you report back with the above details, and also the version and
language of your Windows system?

Thanks
Exciter
Posts: 2
Joined: Fri Jan 06, 2017 1:24 am

Re: IFW Backup Batch Script by Tom Cole - Update 13-Sep-2016

Post by Exciter »

Thanks, I set it the same as another computer and the script works. Not sure why it wasn't set correctly as it was a stock install of win7.
Thank you for the help. Hopefully I have everything else setup correctly and the scheduled task works as expected.
TAC109
Posts: 273
Joined: Tue Sep 06, 2011 10:41 pm

Re: IFW Backup Batch Script by Tom Cole - 13-Jan-2017

Post by TAC109 »

13-Jan-2017 Vn 4.11 - Bug fixes.

- Fixed a prompt in the 'Incorporate old backups' option to indicate
that it is necessary to use the correct case when entering the
'before noon' character. Note that, due to a bug in DOS, the file
times shown in this option can be off by one hour during the
daylight savings period of the year.

- Fixed a bug whereby the calculation of elapsed times for a period
which went over midnight would be incorrect.

- Added a description of the optional IFW /dpwr parameter to the
'set ext' entry in the IFW_Env.cmd file. This parameter can be
used to prevent changes to the power options on the IFW window.

- Added information on checking that the year format is correct, to
the 'set year' entry in the IFW_Env.cmd file.

See the first post for download instructions.
Last edited by TAC109 on Wed Sep 20, 2017 1:40 am, edited 1 time in total.
YesAndNo
Posts: 44
Joined: Sat Aug 24, 2013 11:14 am

Re: IFW Backup Batch Script by Tom Cole - 13-Jan-2017

Post by YesAndNo »

Hello Tom,
I'm having problems updating to the latest version.

Here's what I'm doing:
Unzip the downloaded file to D:\Downloads\IFW_Backup\
Run D:\Downloads\IFW_Backup\IFW_Backup_Set_up_4.11.exe
Select option 1 and unpack to F:\IFW_Backup\
Check that "F:\IFW_Backup\IFW_Backup_Install_From\" is created with files inside (it is)
Run D:\Downloads\IFW_Backup\IFW_Backup_Set_up_4.11.exe again and selection option 2
In the dialog that opens, select F:\IFW_Backup\ and select "Yes".
This produces following:

Checking...
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory
find: vn=: No such file or directory

Some package files are missing or incorrect!
[cmd=0(3) myd=0(6) txt=0(4)]

The IFW_Backup_Install_From folder is corrupt!
Please re-run IFW_Backup_Set_up_4.11.exe with 1st action checked to
recreate the IFW_Backup_Install_From folder.
Press any key to continue . . .

I expect it is me. Thanks for any help.
Barry.
Post Reply