PDA

View Full Version : Backup Problem


Lloyd45
06-19-2004, 03:01 AM
OK, about a month back I lost all my data on my hard drive due to an error, and after scare the other day, even though it was fine, I decided that I will take a hard drive out of my other old PC (which has two HDDs) and place it in my new one, and every day/week or so back it up onto it automatically...

I found a post on the forums hoswing the code to make a batch file to do so, but if I run it from the WinRAR folder as stated backing up files from HDD C:/ to HDD G:/ when it gets to the winRAR part of the operation, it just seems to close and go away - ending up not backing up anything, but, if I back up from a folder on C:/ to another folder on C:/ it works perfectly

Heres the code Im using:


XCOPY "C:\Documents and settings\kunwar\My Documents\USB BACK UP" "G:\Backup\SMCS" /y/i/s
RMDIR "G:\Backup" /s/q
winrar a -r -M5 -MD4096 -Y -O+ -PMIKE -EP -ac -vn -ep1 -agDD-MMM-YY -df "G:\backup.rar" "G:\Backup"


Thanks for any help

Designer
06-19-2004, 05:32 AM
If my memory of M$-DOS serves me correctly then the first line of the batch file is wrong as it's not using standard length filenames (8 characters + 3 character extension).

Folders created with windows support longer filenames than MS-DOS does so in DOS to get the folder you want it's basically a case of only using the first 6 characters of the filename excluding spaces then normally ~1

try replacing the XCOPY line with:

XCOPY C:\Docume~1\kunwar\mydocu~1\USBBAC~1

I dont think you should be using the quotation marks either.

Hope this helps

Lloyd45
06-19-2004, 05:53 AM
Thanks for the help :)

I think it was the quotation marks that you said about, I took them away and it worked - thanks again :)

Designer
06-19-2004, 05:58 AM
No problem Lloyd45,

Found this, might be of interest to you:

http://goforit.unk.edu/msdos/msdos18.htm

It's a guide to writing batch files, think i've found stuff out from there before