Go Back   Access World Forums > Apps and Windows > Other Software

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 10-16-2009, 10:45 AM   #1
irish634
Newly Registered User
 
Join Date: Sep 2008
Posts: 230
Thanks: 5
Thanked 6 Times in 5 Posts
irish634 is on a distinguished road
xcopy log file

Hi Everyone,

I've been poking around ad this for a few days and can't seem to come up with an answer.

I am using an old school batch file calling the xcopy function to back up some OEM equipment files.

Code:
IF EXIST C:\BackupLog.TXT GOTO LOG

:CREATE
ECHO Backup Log > C:\BackupLog.TXT
ECHO. >> C:\BackupLog.TXT

:LOG
Echo ------------------------- >> C:\BackupLog.TXT
Echo NetworkCopy Started: %date% %time%  >> C:\BackupLog.TXT
xcopy /e/h/r/y "c:\test" "Y:\test" >> C:\BackupLog.TXT
If ErrorLevel 0 Echo Files Copied Without Error >> C:\BackupLog.TXT
If ErrorLevel 1 Echo No Files Found to Copy >> C:\BackupLog.TXT
If ErrorLevel 2 Echo User Pressed CTRL+C To Stop Backup >> C:\BackupLog.TXT
If ErrorLevel 4 Echo Invalid Drive or Low Memory >> C:\BackupLog.TXT
If ErrorLevel 5 Echo Disk Write Error Occured >> C:\BackupLog.TXT
Echo NetworkCopy Ended: %date% %time%  >> C:\BackupLog.TXT
Echo ------------------------- >> C:\BackupLog.TXT

cls
@Exit
This works fine except I don't really need to log ALL the files that are backed up which comes from my highlighted text.

The resulting log file produces this:
-------------------------
NetworkCopy Started: Fri 10/16/2009 14:32:36.12
C:\test\Lead_Forming.mdb
C:\test\New Text Document.txt
C:\test\winzip.log
3 File(s) copied
Files Copied Without Error
NetworkCopy Ended: Fri 10/16/2009 14:32:36.50
-------------------------

This is only a test folder. The folders I am copying have 1000's of files. I of course don't need a log of all the file names that were copied. However I would still like to list the number of files that were copied as well as only a list of those files that WERE NOT copied or had a problem.

Is there an easy way to do this?

Thanks,
Craig

irish634 is offline   Reply With Quote
The Following User Says Thank You to irish634 For This Useful Post:
accesspm2012 (08-14-2014)
Old 11-05-2009, 07:36 AM   #2
mcclunyboy
Newly Registered User
 
Join Date: Sep 2009
Posts: 292
Thanks: 6
Thanked 4 Times in 4 Posts
mcclunyboy is on a distinguished road
Re: xcopy log file

Hi,

im not sure...I am pretty sure the /D switch which copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.

If your PC is newer you could use Robocopy which is slightly better - think that is vista only..

Sorry I can't be more help.
mcclunyboy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning method (keep your source mdb safe) pkstormy Sample Databases 0 04-13-2008 11:26 PM
Log changes made to mdw security file acehowell General 3 03-25-2008 08:37 AM
Pausing for Batch runtime tfaiers Forms 3 08-09-2006 07:12 AM
Importing a log file - problems and confusion - please help! iboy General 5 02-28-2005 02:19 AM




All times are GMT -8. The time now is 09:40 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World