1.

Solve : Batch Log file check points?

Answer»

I have created a log file that will automatically backup by overwriting.  How would I enhance it to backup up for five days, (Mon-Sat) and then, depending on the day it was executed, automatically backup to that specific folder?

 ALSO, how do I script check points that will log if the backup start & end were successful, failed, or cancelled? I already have the script that will successfully create a start and end entry which INCLUDES %day%, %time% and %computername% to a specific directory.


ThanksDepending on your OS something like this may work:

SET dow=%date:~0,3%

%dow% should then be set to day of WEEK which you can use in your logic to point to the appropriate folder.

As for part 2 of your question, consider checking errorlevels and outputting appropriate MESSAGES. Be aware not all programs issue errorlevels.

  Quote from: Sidewinder on April 07, 2007, 07:01:37 AM

Depending on your OS something like this may work:

set dow=%date:~0,3%
No, it depends on your time layout/format.
For example (win xp):
1. Go to Control Panel
2. Open Regional and Language settings
3. On the Regional Options tab, click Customize
4. Click on the Time tab
5. there is a 'time format' drop down menu. If that changes, so will what time say in Command Prompt.


Discussion

No Comment Found