I'm using a backup script, that simply copies files over to a separate partition as a backup. The problem is that I get a 'sharing violation' error and I'm not sure "what file it is talking about". I've looked at the help file of Windows command xcopy and I haven't found any option that is relevant.
Has anyone encountered similar problems and resolved them?
My budget doesn't permit me to purchase enterprise solutions (e.g. Veritas/Symantec) because I'm just backing up a single folder, so a simple solution would be appreciated.
backup script
@echo off
rem xcopy /Y "C:\Documents and Settings\Administrator\My Documents\My Virtual Machines" "J:\Backup\Elsueno\My Virtual Machines" /E /C /H /R /K > backup_1.log
rem xcopy /Y "C:\Documents and Settings\Administrator\My Documents\downloads" "J:\Backup\Elsueno\Downloads in Progress" /E /C /H /R /K > backup_2.log
xcopy /Y "C:\Virtual Machines" "J:\Backup\Elsueno\My Virtual Machines" /E /C /H /R /K > backup_1.log
Hi, and welcome to the WTT forums
Here's all you need to know about simple batch files that will do the job for you and at no cost http://www.speedguide.net/read_articles.php?id=1547
Good luck
Regards
paws
What it means is to redirect Standard Error (STDER) to Standard Output (STDOUT). Try it and see is it records the info you need.
The only problem is that I still require to log the events (not just the errors). I tried updating the command, as follows but, somehow no files are copied when I run this command:
I haven't done any batch work in awhile so forgot the correct syntax. Please post back with results of how it works for you and if you get the info logged that you need. Good luck.
Well I tried it out, but the error is still not written to the log file. I thought this would work as it should work with ux scripts.
For the sake of completeness, I tested it as follows:
1. Denying all rights to a file (expecting an access denied error)
2. Running the backup script
The access denied error was written to the terminal but not to the backup.log file.
Jon,
Do you say any of the file names of the files being copied? Or does this error occur and that message is all you see?
Also are you trying to get the error written to the log only so you can see what file it is, if not you can try the /F argument which will display full sources and destinations, I'm not sure if that will show you the file causing it, but it might.
Depending on how many files your trying to copy, you can use the /P method to be prompted to copy each one, it would take a while but you can then copy each file one by one until you reach the error, then look at whats been copied (I think it goes in alphabetical order) and then go to the folder and see what came after the last one it did. Time wasting maybe, but if you are only backing up a few files, it may be worth it.
Is anything else written to the log file? Is it always blank or do you get the results of all the successful transfers too?