Re: Daily Backup

Tech-Archive recommends: Fix windows errors by optimizing your registry



Getting the error Divide by zero error.10 was unexpected at this time.

The folder generated by the application is this format 20080709, will it be
any issue.

C:\Data\Batch>backup.bat

C:\Data\Batch>FOR /F "tokens=1* delims= " %A IN ('DATE/T') DO IF "%B" == "" (
SET
Date=%A
) ELSE (SET Date=%B )

C:\Data\Batch>IF "07/09/2008 " == "" (
SET
Date=Wed
) ELSE (SET Date=07/09/2008 )

C:\Data\Batch>for /F "Tokens=1-4 Delims=. " %i in ('echo.07/09/2008 ') do
set da
y=%i

C:\Data\Batch>set day=07/09/2008

C:\Data\Batch>for /F "Tokens=1-4 Delims=. " %i in ('echo.07/09/2008 ') do
set mo
nth=%j

C:\Data\Batch>set month=

C:\Data\Batch>for /F "Tokens=1-4 Delims=. " %i in ('echo.07/09/2008 ') do
set ye
ar=%k

C:\Data\Batch>set year=

C:\Data\Batch>set dt=--07/09/2008 ***today date

C:\Data\Batch>set /A yesterday=07/09/2008 - 1
Divide by zero error.
10 was unexpected at this time.
C:\Data\Batch>if LSS 10 set yesterday=0
C:\Data\Batch>


"Tom" <"znjicki[spam]" wrote:

FOR /F "tokens=1* delims= " %%A IN ('DATE/T') DO IF "%%B"=="" (SET
Date=%%A) ELSE (SET Date=%%B)
for /f "Tokens=1-4 Delims=. " %%i in ('echo.%date%') do set day=%%i
for /f "Tokens=1-4 Delims=. " %%i in ('echo.%date%') do set month=%%j
for /f "Tokens=1-4 Delims=. " %%i in ('echo.%date%') do set year=%%k

set dt=%day%-%month%-%year% ***today date

set /A yesterday=%day% - 1

if %yesterday% LSS 10 set yesterday=0%yesterday%

set yesterdate=%yesterday%-%month%-%year% *** yesterday date

xcopy c:\Program Files\Logger\Channel1\%yesterdate% e:\data

----all this in some batch file and schedule it to run

This is example but it doesnt include if it is a leap year or if it is
the first day of the month. To do that you must add sevaral different
subrutines..

look at http://www.robvanderwoude.com/datetiment.html#Yesterday


DD wrote:
Soory, my question may be not clear in my first port.

In windows, how to write a batch to copy yesterday's date folder to anothere
directory.

I see a lot of post in Unix but not sure how to do it in windows.



"DD" wrote:

Everyday the program will generate the new folder using the ddmmyyyy format.

I want to backup the folder with yesterday's data using the backup schedule
job.

how to create the backup batch file.

@echo off

xcopy c:\Program Files\Logger\Channel 1\ddmmyy e:\data, how to make it so
that the batch job know it's yesterday date folder.


.



Relevant Pages

  • Re: "Find" function always ZERO results (Panther Mac Mini)
    ... > "Find" function comes back with ZERO results. ... > right on his desktop or items within a folder. ... > staring at the file. ... > I am also running Panther but have never had this ...
    (comp.sys.mac.system)
  • Re: SyncToy has the capability of destroying your data!
    ... and you sync those zero bytes over to the ... on 2 machines with a multitude of files ... as a storage device for those laptop files you can ... a special folder on your pc for those laptop files. ...
    (microsoft.public.windowsxp.photos)
  • Access is Denied (File error)
    ... After restoring files from a backup that i made, ... administrator account can't delete the empty folder. ... I think that the problem i'm having with this zero byte ... was archived by me using Backup, ...
    (microsoft.public.windowsxp.security_admin)
  • "Find" function always ZERO results (Panther Mac Mini)
    ... "Find" function comes back with ZERO results. ... we would enter files or folder names we were staring at ... I am also running Panther but have never had this ...
    (comp.sys.mac.system)
  • Re: Setting the auto-archiving folder via script
    ... checked a few systems and didn't find a value 001f032c in any profile, ... I'm trying to write a script to be added to the logon ... This script will have to set a different auto-archiving folder than the ... It appears coded with a zero at the end: ...
    (microsoft.public.outlook.program_vba)