Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup in day by day

Status
Not open for further replies.

giridpi

Programmer
Dec 5, 2003
33
IN
I want day take backup in day by day in separate directory in my all dbf files. Like mon,tue,wed.. How can i meke please guide me with program.

Thanking you
 
Giridpi,
for example
name_day = left(cdow(date()),3)
!copy *.dbf c:\mybkdir\&name_day\*.dbf
do mybackup
Tesar
 
Another option using XCOPY command

Consider not using foxpro to do the job, and look at the following. Please examine the sysntax of xcopy to see how powerful it is (Xcopy /?).

Create 5 subdirectories of your backup Directory e.g. c:\backup\mon , c:\backup\tues, etc

Create 5 batch files from your command prompt (XP) or DOS prompt (Win98) (called mon.bat to fri.bat)

for day of week = Mon to Friday
call the first mon.bat and the code in the batch file is one line

xcopy c:\source\*.* c:\backup\mon\*.* /s /y /d /h /c

This will backup all files including memo,index,dbf, etc. plus subdirectories, which are older than the files in the existing destination directory.
Use Windows scheduler to run the batch files
Similarly for Tuesday to Friday


All files should be closed for the above to function fully.
I use Novell Netware copy which allows a backup of open files to another netware volume. I then use xcopy to copy the netware backup. Xcopy does not handle open files


 
try above the following

modi comm mbak

clea

tfs (programmer)

tmpm= alltrim(str(month(date())))
tmpd = alltrim(str(day(date())))
tmpy = alltrim(str(year(date())))
TMPM = iif(len(tmpm)= 1,'0'+TMPM,TMPM)
TMPd = iif(len(tmpd)= 1,'0'+TMPd,TMPd)
mbak = 'sav'+substr(tmpy,4,1)+tmpm+tmpd
!md &mbak
!copy *.* &mbak

do mbak

creates sub-dir such as sav40212
 
try above the following

modi comm mbak

tmpm= alltrim(str(month(date())))
tmpd = alltrim(str(day(date())))
tmpy = alltrim(str(year(date())))
TMPM = iif(len(tmpm)= 1,'0'+TMPM,TMPM)
TMPd = iif(len(tmpd)= 1,'0'+TMPd,TMPd)
mbak = 'sav'+substr(tmpy,4,1)+tmpm+tmpd
!md &mbak
!copy *.* &mbak

do mbak

creates sub-dir such as sav40212
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top