SCOUG-HELP Mailing List Archives
Return to [ 13 |
October |
2002 ]
>> Next Message >>
6
=====================================================
If you are responding to someone asking for help who
may not be a member of this list, be sure to use the
REPLY TO ALL feature of your email program.
=====================================================
This is a multi-part message in MIME format.
Content Type: text/plain
Content-Transfer-Encoding: 7bit
Butch,
If you do not have a reliable way to back up your important system files
(like the CONFIG.SYS and OS2.INI files), attached please find 4 scripts
that you can use to help you with that task.
Use the REXX program, BUTCH.CMD, to copy (back up) the following files:
1. CONFIG.SYS
2. ...,\Desktop\*.*
3. ...,\OS2\OS2.INI
4. ...,\OS2\OS2SYS.INI
5. ...,\OS2\DLL\SCENTER.CFG
6. ...,\OS2\DLL\DOCK*.CFG
It will copy up to 20 generations of these files. It creates the
following folders on your boot drive (I believe your boot drive is
"C:\", right?):
C:\BUTCH
C:\BUTCH\Desktop
C:\BUTCH\Desktop\Backup_01
C:\BUTCH\Desktop\Backup_02
C:\BUTCH\Desktop\Backup_03
...,
...,
C:\BUTCH\Desktop\Backup_20
The most recent, backed up generation will be in
"C:\BUTCH\Desktop\Backup_01". After that, the next recent will be in
"C:\BUTCH\Desktop\Backup_02", etc., etc.
When you run the program, it erases everything in
"C:\BUTCH\Desktop\Backup_20" and moves everything else down one.
"C:\BUTCH\Desktop\Backup_19" becames "C:\BUTCH\Desktop\Backup_20",
"C:\BUTCH\Desktop\Backup_18" becomes "C:\BUTCH\Desktop\Backup_19", etc.
Finally, the backup that it makes is stored in
"C:\BUTCH\Desktop\Backup_01".
You MUST place BUTCH.CMD somewhere on your boot partition (anywhere on
the C:\ drive). DO NOT place it on D:\, or E:\, etc. If you do, it will
NOT work.
Next, the 3 programs, BUTCH1.CMD, BUTCH2.CMD and BUTCH3.CMD, are OS/2
batch file programs. Use them to restore the following files to your
system:
Batch Program Restore Files
BUTCH1.CMD OS2.INI, OS2SYS.INI
BUTCH2.CMD CONFIG.SYS
BUTCH3.CMD Desktop\*.*
These 3 programs are designed to use from a floppy diskette. The idea is
that you cannot boot your system, because of some problem with these
files. Or, perhaps you can boot, but your desktop is wiped out/in error,
etc. If so, you boot up a minimal OS/2 system, using your OS/2 utility
diskettes (I assume that you do not have an OS/2 maintenance partition
on your system and that you boot from floppies, when you have trouble).
So therefore, you boot up a minimal OS/2 system from the utility
diskettes. Then, you switch to the diskette that has BUTCH1.CMD,
BUTCH2.CMD and BUTCH3.CMD. Using these you restore from the archived
generations that you made with BUTCH.CMD. For example, suppose you want
to restore your CONFIG.SYS file, saved in C:\BUTCH\Desktop\Backup_03. If
so, you type and enter "BUTCH2.CMD 03" on the commandline (without the
quotes). If you want to restore the desktop files saved in
C:\BUTCH\Desktop\Backup_19, you type and enter "BUTCH3.CMD 19" on the
commandline. If you want to restore the OS2.INI and OS2SYS.INI files,
stored on C:\BUTCH\Desktop\Backup_05, you type and enter "BUTCH1.CMD
05".
If you use a maintenance partition, you can save these 3 programs,
BUTCH1.CMD, BUTCH2.CMD and BUTCH3.CMD anywhere on that partition and use
them from there. You have to go to an OS/2 commandline to use them. Use
a full screen commandline, not a windowed commandline. These 3 programs
are batch file programs, not REXX programs. If you are using the utility
diskettes, REXX will not be available in your minimal OS/2 system. But
batch programs will work there. That's why they are batch programs!
Well, you can use these programs, or not! It's your choice. Notice that
I did not write a batch program to restore the ...,\OS2\DLL\SCENTER.CFG
and ..,\OS2\DLL\DOCK*.CFG files. You can do that, if you like, using the
BUTCH1.CMD, BUTCH2.CMD and BUTCH3.CMD examples.
HCM
_____________________________________________________________________________
Steven Levine wrote:
>
> =====================================================
> If you are responding to someone asking for help who
> may not be a member of this list, be sure to use the
> REPLY TO ALL feature of your email program.
> =====================================================
>
> In <3DA82A7F.B7E6C8DC@attglobal.net>, on 10/12/02
> at 05:58 AM, Harry Chris Motin said:
>
> >the Main Menu. Learn something NEW everyday. However, it is essential, I
> >believe, that Butch load the CONFIG.SYS into an Editor without any word
> >wrapping!!!! He wants to see each and every line as a single line, so
> >that he knows where each one begins (at the far left-hand side) and where
> >it ends (at the end of that line on the right).
>
> This I agree with, although since almost all editors will wrap lines, I
> would say that Butch needs to be sure that word wrapping is turned off.
>
> FWIW, with EPM, there's no way to prevent word wrapping at character 1699.
> Fortunately, I've never seen a config.sys line this long. I don't know
> what E's line length limit is.
>
> >Steven, I assume you also mean to copy the, CONFIG.SYS, OS2.INI and
> >OS2SYS.INI files, too. Unless Butch has a backup program, perhaps the
>
> These are included. To be able to fully restore the Desktop you need
> copies of:
>
> os2.ini
> os2sys.ini
> config.sys
> scenter.cfg
> dock*.cfg
>
> as a bare minumum. It can be useful to back up additional files, even
> though they are not part of the Desktop, per se. Svobi's list is a pretty
> good one. I capture even more using Unimaint's Supplemental Backup. The
> file compression is useful and the files retain their original names.
> This make it easier to restore one or two, on demand.
>
> >easiest way for him to make a backup of ALL the essential files is to use
> >XCOPY with the options to copy subdirectories, empty directories, hidden
> >files, system files and read only files. That way he will make an exact
> >copy of "C:\Desktop\..."
>
> True, but Unimaint does all this with less fuss, as does RoboSave.
>
> Steven
>
> --
> ---------------------------------------------------------------------
> "Steven Levine" MR2/ICE 2.35 #10183 Warp4/FP15/14.085_W4
> www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
> ---------------------------------------------------------------------
>
> =====================================================
>
> To unsubscribe from this list, send an email message
> to "steward@scoug.com". In the body of the message,
> put the command "unsubscribe scoug-help".
>
> For problems, contact the list owner at
> "rollin@scoug.com".
>
> =====================================================
Content Type: text/plain
name="BUTCH.CMD"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="BUTCH.CMD"
/*This REXX program creates archived generations of your CONFIG.SYS, OS2.INI, OS2SYS.INI and Desktop files*/
/*Begin setting some program variables*/
Red_Text = "1B"x || "[1;31;40m"
Ansi_Off = "1B"x || "[0m"
DesiredArchiveDirectoryFullLevel = "BUTCH\Desktop\Backup_"
DesiredArchiveDirectoryLevel1 = "BUTCH"
DesiredArchiveDirectoryLevel2 = "Desktop"
DesiredArchiveDirectoryLevel3 = "Backup_"
MaximumNumberOfGenerations = 20
/*End setting some program variables*/
/*Begin loading the REXX Utility functions in order to use the SYSFILEDELETE() function*/
REXXUtilityFlag = RXFUNCQUERY("SYSLOADFUNCS")
IF REXXUtilityFlag \= 0 THEN DO
CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
CALL SysLoadFuncs
END /*Ends "IF REXXUtilityFlag \= 0 THEN DO" Section*/
/*End loading the REXX Utility functions in order to use the SYSFILEDELETE() function*/
/*Begin finding the File Spec information on this REXX program, or script, and assigning its value to the variable, ProgramLocation, here in this program*/
PARSE SOURCE OperatingSystem HowCalled FileSpec
ProgramLocation = ""
FileSpecPortion = FileSpec
DO UNTIL FileSpecPortion = ""
PARSE Var FileSpecPortion FirstPart "\" SecondPart
SELECT
WHEN ProgramLocation = "" & SecondPart \= "" THEN ProgramLocation = FirstPart
WHEN ProgramLocation \= "" & SecondPart \= "" THEN ProgramLocation = ProgramLocation"\"FirstPart
OTHERWISE NOP
END /*Ends "SELECT" Section*/
FileSpecPortion = SecondPart
END /*Ends "DO UNTIL FileSpecPortion = """ Section*/
PARSE Var ProgramLocation BootDrive ":" Remainder
BootDrive = BootDrive":"
/*End finding the File Spec information on this REXX program, or script, and assigning its value to the variable, ProgramLocation, here in this program*/
/*Begin the opening introduction*/
RC = SYSCLS()
SAY ""
SAY "This REXX script makes a copy of the following files:"
SAY ""
SAY " 1. "BootDrive"\CONFIG.SYS"
SAY " 2. "BootDrive"\Desktop\*.*"
SAY " 3. "BootDrive"\OS2\OS2.INI"
SAY " 4. "BootDrive"\OS2\OS2SYS.INI"
SAY " 5. "BootDrive"\OS2\DLL\SCENTER.CFG"
SAY " 6. "BootDrive"\OS2\DLL\DOCK*.CFG"
SAY ""
SAY "It will create "MaximumNumberOfGenerations" generations of these files and place them in the:"
SAY ""
SAY " "BootDrive"\"DesiredArchiveDirectoryFullLevel"XX"
SAY ""
SAY "directories. The most recent generation (this next one) will be in:"
SAY ""
SAY " "BootDrive"\"DesiredArchiveDirectoryFullLevel"00"
SAY ""
SAY "The next youngest will be in ...\"DesiredArchiveDirectoryLevel3"01, then ...\"DesiredArchiveDirectoryLevel3"02, etc."
SAY ""
SAY " "Red_Text"1"Ansi_Off'. Type and enter "1" to continue.'
SAY " "Red_Text"2"Ansi_Off". Press the "Red_Text"ENTER"Ansi_Off" key, only, to do nothing and terminate."
SAY ""
SAY "ENTER your response now."Red_Text
PARSE PULL KeyResponse
SAY ""Ansi_Off
RC = SYSCLS()
SELECT
WHEN KeyResponse = 1 THEN NOP
OTHERWISE SIGNAL FINISH
END
/*End the opening introduction*/
/*Begin finding the generations of the archived data, moving the data generations and setting up for receiving the next generation*/
ArchiveSearchPathResults = ""
ArchiveSpecLocation = BootDrive"\"DesiredArchiveDirectoryLevel1"\"DesiredArchiveDirectoryLevel2"\*.*"
RC = SYSFILETREE(ArchiveSpecLocation, "ArchiveSearchPathResults", "DO")
Generation. = ""
Generation.0 = 0
SELECT
WHEN ArchiveSearchPathResults.0 = 0 THEN DO /*If necessary, create archive directory*/
NewDirectory1 = BootDrive"\"DesiredArchiveDirectoryLevel1
NewDirectory2 = BootDrive"\"DesiredArchiveDirectoryLevel1"\"DesiredArchiveDirectoryLevel2
RC = SYSMKDIR(NewDirectory1)
RC = SYSMKDIR(NewDirectory2)
END /*Ends "WHEN ArchiveSearchPathResults.0 = 0 THEN DO" Section*/
OTHERWISE DO
J = 0
DO I = 1 TO ArchiveSearchPathResults.0 BY 1
FirstPart = ""
SecondPart = ""
PARSE Var ArchiveSearchPathResults.I FirstPart "_"SecondPart
IF SecondPart \= "" THEN DO
J = J + 1
Generation.Name.J = ArchiveSearchPathResults.I
Generation.Number1.J = SecondPart
IF LEFT(SecondPart, 1) = 0 THEN Generation.Number2.J = RIGHT(SecondPart, 1)
END /*Ends "" Section*/
END I /*Ends "DO I = 1 TO ArchiveSearchPathResults.0 BY 1" Section*/
Generation.0 = J
END /*Ends "OTHERWISE DO" Section*/
END /*Ends "SELECT" Section*/
SELECT
WHEN Generation.0 = MaximumNumberOfGenerations THEN DO
DO I = Generation.0 TO 2 BY -1
J = I - 1
IF J < 10 THEN FirstDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"J
ELSE FirstDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel||J
IF I < 10 THEN SecondDirectory = DesiredArchiveDirectoryLevel3"0"I
ELSE SecondDirectory = DesiredArchiveDirectory3||I
SELECT
WHEN I = MaximumNumberOfGenerations THEN DO
IF I < 10 THEN RemoveDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"I"\*.*"
ELSE RemoveDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel||I"\*.*"
Count = 2
DO UNTIL Count = 1 /*Rountine to empty and remove the last archived generation*/
CALL REMOVEEMPTYDIRECTORY
IF I < 10 THEN RemoveDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"I"\*.*"
ELSE RemoveDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel||I"\*.*"
END /*Ends "DO UNTIL Count = 1" Section*/
CommandLine = "RENAME "FirstDirectory" "SecondDirectory
IF RC = 0 THEN INTERPRET '"'CommandLine'"'
END /*Ends "WHEN I = MaximumNumberOfGenerations THEN DO" Section*/
OTHERWISE DO
CommandLine = "RENAME "FirstDirectory" "SecondDirectory
INTERPRET '"'CommandLine'"'
IF J = 1 THEN DO
NewDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"J
RC = SYSMKDIR(NewDirectory)
END /*Ends "IF J = 1 THEN DO" Section*/
END /*Ends "OTHERWISE DO" Section*/
END /*Ends "SELECT" Section*/
END I /*Ends "DO I = Generation.0 TO 2 BY -1" Section*/
END /*Ends "WHEN Generation.0 = MaximumNumberOfGenerations THEN DO" Section*/
WHEN Generation.0 > 0 & Generation.0 < MaximumNumberOfGenerations THEN DO
DO I = Generation.0 TO 1 BY -1
J = I + 1
IF I < 10 THEN FirstDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"I
ELSE FirstDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel||I
IF J < 10 THEN SecondDirectory = DesiredArchiveDirectoryLevel3"0"J
ELSE SecondDirectory = DesiredArchiveDirectory3||J
CommandLine = "RENAME "FirstDirectory" "SecondDirectory
INTERPRET '"'CommandLine'"'
IF I = 1 THEN DO
NewDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"0"I
RC = SYSMKDIR(NewDirectory)
END /*Ends "IF J = 1 THEN DO" Section*/
END I /*Ends "DO I = Generation.0 TO 1 BY -1" Section*/
END /*Ends "Generation.0 > 0 & Generation.0 < MaximumNumberOfGenerations THEN DO" Section*/
WHEN Generation.0 = 0 THEN DO
NewDirectory = BootDrive"\"DesiredArchiveDirectoryFullLevel"01"
RC = SYSMKDIR(NewDirectory)
END /*Ends "WHEN Generation.0 = 0 THEN DO" Section*/
OTHERWISE NOP
END /*Ends "SELECT" Section*/
/*End finding the generations of the archived data, moving the data generations and setting up for receiving the next generation*/
/*Begin copying the specified files to the archive*/
CommandLine = "ECHO OFF"
INTERPRET '"'CommandLine'"'
DestinationFolder = BootDrive"\"DesiredArchiveDirectoryFullLevel"01\"
CopyFile = BootDrive"\CONFIG.SYS"
CommandLine = "XCOPY "CopyFile" "DestinationFolder" /A"
INTERPRET '"'CommandLine'"'
CopyFile = BootDrive"\OS2\OS2.INI"
CommandLine = "XCOPY "CopyFile" "DestinationFolder" /A /H /R /T"
INTERPRET '"'CommandLine'"'
CopyFile = BootDrive"\OS2\OS2SYS.INI"
CommandLine = "XCOPY "CopyFile" "DestinationFolder" /A /H /R /T"
INTERPRET '"'CommandLine'"'
CopyFile = BootDrive"\OS2\DLL\SCENTER.CFG"
CommandLine = "XCOPY "CopyFile" "DestinationFolder" /A"
INTERPRET '"'CommandLine'"'
FileSpec = BootDrive"\OS2\DLL\DOCK*.CFG"
MatchingFiles. = ""
RC = SYSFILETREE(FileSpec, MatchingFiles,"FO")
IF MatchingFiles.0 > 0 THEN DO
DO K = 1 TO MatchingFiles.0 BY 1
CopyFile = MatchingFiles.K
CommandLine = "XCOPY "CopyFile" "DestinationFolder" /A"
INTERPRET '"'CommandLine'"'
END K /*Ends "" Section*/
END /*Ends "IF MatchingFiles.0 > 0 THEN DO" Section*/
CommandLine = XCOPY BootDrive"\Desktop "BootDrive"\"DesiredArchiveDirectoryFullLevel"01\ /S /E"
INTERPRET '"'CommandLine'"'
/*End copying the specified files to the archive*/
/*Begin removing the "Hidden", "Read-Only" and "System" attributes from the OS2*.INI files*/
FileSpecification = BootDrive"\"DesiredArchiveDirectoryFullLevel"01\*.*"
RC = SYSFILETREE(FileSpecification, MatchingFiles, "FO", "*****", "-----")
/*End removing the "Hidden", "Read-Only" and "System" attributes from the OS2*.INI files*/
/*Begin deregistering the REXX Utility functions*/
FINISH:
IF REXXUtilityFlag \= 0 THEN CALL SysDropFuncs
/*End deregistering the REXX Utility functions*/
EXIT
REMOVEEMPTYDIRECTORY:
Count = 0
DO UNTIL RemoveDirectorySearchResults.0 = 0
Count = Count + 1
RemoveDirectorySearchResults. = ""
RC = SYSFILETREE(RemoveDirectory, "RemoveDirectorySearchResults", "DO")
IF RemoveDirectorySearchResults.0 > 0 THEN RemoveDirectory = RemoveDirectorySearchResults.1"\*.*"
END /*Ends "DO UNTIL RemoveDirectorySearchResults.0 = 0" Section*/
FileSpecification = RemoveDirectory
MatchingFiles. = ""
RC = SYSFILETREE(FileSpecification, MatchingFiles, "FO", "*****", "-----")
IF MatchingFiles.0 > 0 THEN DO
DO K = 1 TO MatchingFiles.0 BY 1
RC = SYSFILEDELETE(MatchingFiles.K)
END K /*Ends "" Section*/
END /*Ends "IF MatchingFiles.0 > 0 THEN DO" Section*/
DesiredLength = LENGTH(RemoveDirectory) - 4
RemoveDirectory = SUBSTR(RemoveDirectory, 1, DesiredLength)
RC = SYSRMDIR(RemoveDirectory)
RETURN
Content Type: text/plain
name="BUTCH1.CMD"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="BUTCH1.CMD"
CLS
REM This batch file is to be used on a floppy diskette. Using
REM the "?" parameter you supplied, it copies the
REM C:\BUTCH\Desktop\Backup_%1\OS2.INI, and
REM C:\BUTCH\Desktop\Backup_%1\OS2SYS.INI files
REM to C:\OS2.INI and C:\OS2\OS2SYS.INI, respectively.
REM
REM Next, it resets the +H attribute on the C:\OS2\OS2*.INI
REM files.
PAUSE
CLS
ECHO OFF
IF %1 == GOTO NOPARAMETER
GOTO PROCEED
:NOPARAMETER
REM You failed to enter a parameter! This batch file will now end!
GOTO EXIT
:PROCEED
ATTRIB -H -R -S C:\OS2\OS2*.*
IF EXIST C:\OS2\OS2.!!! ERASE C:\OS2\OS2.!!!
IF EXIST C:\OS2\OS2SYS.!!! ERASE C:\OS2\OS2SYS.!!!
ECHO ON
COPY C:\BUTCH\Desktop\Backup_%1\OS2.INI C:\OS2\OS2.INI
COPY C:\BUTCH\Desktop\Backup_%1\OS2SYS.INI C:\OS2\OS2SYS.INI
ATTRIB +H C:\OS2\OS2*.INI
:EXIT
Content Type: text/plain
name="BUTCH2.CMD"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="BUTCH2.CMD"
CLS
REM This batch file is to be used on a floppy diskette. Using
REM the "?" parameter you supplied, it copies the
REM C:\BUTCH\Desktop\Backup_%1\CONFIG.SYS file to
REM C:\CONFIG.SYS
PAUSE
CLS
ECHO OFF
IF %1 == GOTO NOPARAMETER
GOTO PROCEED
:NOPARAMETER
REM You failed to enter a parameter! This batch file will now end!
GOTO EXIT
:PROCEED
ECHO ON
COPY C:\BUTCH\Desktop\Backup_%1\CONFIG.SYS C:\CONFIG.SYS
:EXIT
Content Type: text/plain
name="BUTCH3.CMD"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="BUTCH3.CMD"
CLS
REM This batch file is to be used on a floppy diskette. Using
REM the "?" parameter you supplied, it copies the
REM C:\BUTCH\Desktop\Backup_%1 file to
REM C:\Desktop\*
PAUSE
CLS
ECHO OFF
IF %1 == GOTO NOPARAMETER
GOTO PROCEED
:NOPARAMETER
REM You failed to enter a parameter! This batch file will now end!
GOTO EXIT
:PROCEED
ECHO ON
XCOPY C:\BUTCH\Desktop\Backup_%1 C:\Desktop\ /S /E /V
:EXIT
>> Next Message >>
Return to [ 13 |
October |
2002 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|