headerphoto
----- TEST SITE -----

RichCopyPlus - Examples

 

Although wrapped in a nice GUI interface, RichCopy is a command-line utility that can be called from the command-line, or in a batch file or scheduler. RichCopyPlus, like RichCopy,  can be called teh same way.
Existing batch jobs calling RichCopy can safely be changed to call RchCopyPlus instead. All parameters will be forwarded to RichCopy.
The immediate gain will be that eventlog entries are now generated.

Below are examples of the fucntionality RichCopyPlus adds to RichCopy.
To learn how to run RichCopy from the command-line or a batch file, click here.

 

To start using the email functionality added by RichCopyPlus, the minimum syntax is:

RichCopyPlus {source} {destination} {optional RichCopy parameters}
/smtp:{smtp_server} /from:{sender_address} /to:{recipient_address}

 

 

For a full list of available parameters, type:

RichCopyPlus /help-richcopyplus

 

 

Parameters are not case sensitive.

Apart from the {source} and {destination} parameters (first and second parameter) there is no specific order in which parameters need to be entered.
No particular sequence of 'native' RichCopy parameters and parameters specific to RichCopyPlus is required either (can be mixe din with each other is deemed convenient.

Parameters that have 'spaces' in them need to be given with "quotes" around them.

 

The basic syntax above can be futher expanded on with one or more of the following options:


 

Send notification

  on 'Error' only: /repError  
  on 'Warning' and 'Error' only: /repWarning
     

Example:

RichCopyPlus {source} {destination} {optional RichCopy parameters}
/smtp:{smtp_server} /from:{sender_address} /to:{recipient_address}
/repWarning

 

 

Attach logfile (requres native RichCopy parameter: /log or /log+)

  on 'Error' only: /attachError  
  on 'Warning' and 'Error' only: /attachWarning
  always ('Success', 'Warning' and 'Error' /attachLog

 

Example:

RichCopyPlus {source} {destination} {optional RichCopy parameters}
/smtp:{smtp_server} /from:{sender_address} /to:{recipient_address}
/repWarning /LOG:{logfile}/attachWarning

 

 

Compress logfile to show Warnings and Errors only

  /repFilter   

 

Example:

RichCopyPlus {source} {destination} {optional RichCopy parameters}
/smtp:{smtp_server} /from:{sender_address} /to:{recipient_address}
/repWarning /LOG:{logfile}/attachWarning /repFilter


 

For a full list of available parameters, type:

RichCopyPlus /help-richcopyplus

 

 

A real life example
Multiple RichCopyPlus in one batch file, writing to the same log

 

Often, one (scheduled) batch file is used to run RichCopyPlus multiple times, backing up different parts of the filesystem. The /QA parameter (native to RichCopy) can be used to conveniently write to the same logfile.
However, it is important that each job is reported on individually in case of an error or warning.

In order to achieve this, here is what we recommend to our customers.

 

 

REM First job will OVERWRITE the logfile if it already exists
REM (‘/QO’)
REM Notification is sent immediately if there is a Warning or an
REM Error, attaching the logfile; the error will be in the last
REM section of the logfile

RichCopyPlus {source1} {destination1} {other parameters} /smtp:{smtp_server} /from:{sender} /to:{recipient} /repFilter
/QO
/QP {mylog.txt} /repWarning /attachWarning

 

REM Subsequent jobs will APPEND to the logfile (‘/QA’)
REM Notification is sent immediately if there is a Warning or an
REM Error, attaching the logfile; the error will be in the last
REM section of the logfile

RoboCopyPlus {source2} {destination2} {other parameters} /smtp:{smtp_server} /from:{sender} /to:{recipient} /repFilter
/QA
/QP {mylog.txt} /repWarning /attachWarning

RichCopyPlus {source3} {destination3} {other parameters} /smtp:{smtp_server} /from:{sender} /to:{recipient} /repFilter
/QA
/QP {mylog.txt} /repWarning /attachWarning

 

REM The last job behaves like the ‘in between’ jobs, appending  to
REM the logfile.
REM Except it ALWAYS sends a notification, even on ‘Success’

RichCopyPlus {source_last} {destination_last} {other parameters} /smtp:{smtp_server} /from:{sender} /to:{recipient} /repFilter
/QA /QP {mylog.txt} /repSuccess /attachWarning

 

 

This assures that we always receive a notification (at the end), telling us that the batch has indeed run. What we hope to see is just a simple ‘Success’ message with no log attached.

If however an exception occurs anywhere between start and finish, one or more ‘Warning’ or ‘Error’ messages will be received. These will have the logfile attached in its form as it was at the moment the exception was reported on.
You will therefore always find the exception in the last section of the logfile.

 

This is possible because RichCopyPlus doesn’t actually ‘scan’ the logfile after it is built by RichCopy.
Instead, it ‘captures’ RichCopy’s logfile and builds its own based on the information captured. This way, it won’t scan and interpret previous sections (created from previous job calls earlier in the batch, writing to the same logfile) and ‘double up’ on previous warnings or errors.