Concerning backup...
EDIT --- You must create the HICA file on the target disk the first time. Always miss something...
This could be done in the file , but since it only has to be done the first time, I left it out. If you wanted to keep copies and you were backing up to a big enough media, the directory would be created on-the-fly with the date as part of the name. eoj
Since only one file fits on the zip, it will have to be deleted before
the new copy can be copied over, running the risk of loosing the data
if the new file has been corrupted, making the backup kind of silly.
You should consider a couple of possibilities. Get a 200 mb or greater
zip to have 2 copies able to fit, erasing the oldest one and copying
the new one over with the backup, or, better, change thru 2 or more
disks to prevent the risk of zipdisk corruption, in case the zip fails,
which they can do. You could rename the target folders with the date in
the name so there would be no foldername problems if you wanted to do
this.
Maybe you should [I would] consider copying the backup to at leastone
other place on your disk, or on another computer. Even better, or
additionally, a packet writing CD or DVD and a set of CD/DVD+Rs or
CD/DVD+RWs would be a good choice to hold an archive, and a much safer
situation.The question is how much trouble is your data worth if you
have to recover. I simply cannot afford to loose data, so I do much of
this, which some would call overkill. In the end, "You pays your money,
you takes your chance".
The program can handle all of this with a little tweaking.
Somewhere, create a place to store your batch files [Program Files\Batch_Files\ is a good place]. Create a new text file, and rename it BACKUP.BAT, or something like that. It must have the .BAT extension
This is not an optimal file, but one that SHOULD work.
Many things could optimize it, but it will let you redefine the target and source. Also, I usually keep a cumulative log of the copy operations, but this was not included to keep it as simple as possible. There is minimal error checking. This also may be more than you want... if so, just dump it.
After you paste in the code, goto explorer and find the file in its directory and put a shortcut to it on the desktop. Double click on it, and it should run in a "dos" window. you can set many of the run and ex it parameters in the shortcut properties.
Test it on a different machine first with model data, and see if any strange things occur, as they can because of the possible differences between pcs, and I wasn't able to check it on yours.
I removed all pauses and directory listings except for the end-of job notification, but feel free to rem or delete it out, and it will run and exit totally automatically. etc.
This can be written many ways, with xcopy, scripts, vb etc, but this is the simplist way to do it, IMHO.
And finally, this may not be anything like what you expected or want, but it was the best I could do in a few minutes with little information.
It runs and does what was stated on 2 of my machines, but, again, some small thing may give you trouble on yours, so Iwould test it.
So, that said...
these are the critical lines, if all you want is a few lines and nothing else.
to erase all the files in the target directory:
del /f /q %to\*.*
to copy over all the old files:
copy /b %from\*.* %to\*.* /v
Just put in the correct "from" and "to".
If you want to use xcopy - faster, depending on the files, but sometimes a problem -then an "X" and few changes in the switches would let it happen. Your call.
otherwise...
open BACKUP.BAT with notepad and cut and paste the following into it:
start paste after this line--------------------------------
@echo off
pause --- ready to run... hit enter
rem
rem HICA backup 14dec03 W2K.SP3
rem
set source_drv=c
set target_drv=g
set source=HICA
set target=HICA
set from="%source_drv:\%source"
set to="%target_drv:\%target"
If not exist %from goto abend
if not exist %to goto abend
rem ------- TO seems to exist so delete files
rem even with ReadOnly set
del /f /q %to\*.*
rem ------- copy as a binary files, verify the file is
rem readable, and set the READ ONLY attribute to prevent
rem casual deletion. Something wrong will create an
rem ERROR message and probably stop the program
copy /b %from\*.* %to\*.* /v
attrib +r %to\*.*
goto exit
:ABEND
rem if not there for whatever reason, notify, and exit on keypress
beep
beep
beep
beep
beep
echo.
echo There is a problem - %from or %to is not available
echo CHECK DRIVE for MEDIA...
echo.
pause HIT ENTER to exit program
:exit
beep
beep
end of paste
.
.
-=ed<P ID="edit"><FONT SIZE=-1><EM>Edited by EdtheROM on 12/15/03 04:18 PM.</EM></FONT></P>