IFW Backup Batch Script by Tom Cole - 24-Apr-2017

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.

IFW Backup Batch Script by Tom Cole - 24-Apr-2017

Postby TAC109 » Fri Sep 09, 2016 6:03 pm

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 post below for details.
. Updated 13-Sep-2016 to vn 4.10 - see post below for details.
. Updated 13-Jan-2017 to vn 4.11 - see post below for details.
. Updated 19-Mar-2017 - Dropbox download address works again.
. Updated 24-Apr-2017 to vn 4.12 - see post below for details.

Updated version is available at
http://bit.ly/2n9wR8O

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.
Last edited by TAC109 on Tue Sep 19, 2017 6:33 pm, edited 11 times in total.
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby TAC109 » Mon Sep 12, 2016 5:56 pm

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 Thu Jan 12, 2017 3:09 pm, edited 1 time in total.
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby TAC109 » Mon Sep 12, 2016 5:59 pm

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.
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby Somebeachsomewhere » Sat Nov 05, 2016 12:59 pm

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.
Somebeachsomewhere
 
Posts: 15
Joined: Sun Dec 04, 2011 4:29 pm

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

Postby TAC109 » Tue Nov 08, 2016 2:22 pm

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.
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby Exciter » Thu Jan 05, 2017 6:33 pm

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?
Exciter
 
Posts: 2
Joined: Thu Jan 05, 2017 6:24 pm

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

Postby TAC109 » Thu Jan 05, 2017 9:50 pm

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
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby Exciter » Fri Jan 06, 2017 2:26 pm

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.
Exciter
 
Posts: 2
Joined: Thu Jan 05, 2017 6:24 pm

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

Postby TAC109 » Thu Jan 12, 2017 3:15 pm

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 Tue Sep 19, 2017 6:40 pm, edited 1 time in total.
TAC109
 
Posts: 215
Joined: Tue Sep 06, 2011 3:41 pm

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

Postby YesAndNo » Mon Feb 06, 2017 1:39 am

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.
YesAndNo
 
Posts: 6
Joined: Sat Aug 24, 2013 4:14 am

Next

Return to Scripting