%ERRORS and all other parameters for Events non operationalbat file

Questions about Cobian Reflector
Post Reply
Frutchy
Posts: 5
Joined: 06 Nov 2021, 19:29

%ERRORS and all other parameters for Events non operationalbat file

Post by Frutchy »

Hi Luis,
Great to see this new program coming! :D

In the times of Gravity, you gave me the possibility to check successful execution by interrogating the %ERROR parameter.
This doesn't seem to work yet/anymore in Reflector.
Perhaps the syntax has changed.
I notice that once I have added the file path, the user interface allows me to enter a parameter, just as before in Gravity.
But the "Edit" button does not allow to really edit the added line, e.g. to encapsulate the command with quotes, and so on.
Hitting "Edit" just offers the possibility to reregister / replace a file path, not edit it.

I use the batch file to display the result (successful / not) at the end of the backup in a big window.
Just because some people don't notice a small icon blinking in the corner of the task bar...
It can sit there for months and people still think their backups run fine...

Thanks in advance if you can find the time to help me with this issue.

Best regards,
Ronald
Last edited by Frutchy on 08 Nov 2021, 10:58, edited 1 time in total.
User avatar
cobian
Site Admin
Posts: 4537
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: %ERROR parameter to use in Post-backup Events bat file

Post by cobian »

In the help file, the parameter %ERRORS is listed.

%ERROR won't work, I'm afraid.
--
Luis Cobian
Cobian Backup's creator
Frutchy
Posts: 5
Joined: 06 Nov 2021, 19:29

Re: %ERRORS and other parameters for Events non operational

Post by Frutchy »

Hi Luis,

I'm sorry for the miswriting. I ment %ERRORS of course.
But it is not only this parameter that is concerned.
I have not tried them all, but a couple of them like %DATETIME, %USERNAME, %DOCUMENTS, %DISKLABEL, etc. and none of them works...

Reflector DOES start the bat files as usual, but they don't receive the parameter values.
As I wrote, it has probably to do with the way the executable files are registered and that it is not possible to edit.

Ronald
User avatar
cobian
Site Admin
Posts: 4537
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by cobian »

Aha.. so you are using parameters in the events? I don't think those are parametrized at all... Must check this our.
--
Luis Cobian
Cobian Backup's creator
Frutchy
Posts: 5
Joined: 06 Nov 2021, 19:29

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by Frutchy »

Hi Luis,

Thank you for having parametrized the events. Great!

One remark though:
The most important parameter I use, %ERRORS, works fine.
Other simple parameters like %DATETIME work as well.
But most other parameters such as %USERNAME or %DBPATH don't.
I don't need them, so I am fine, but such parameters might be of interest to others.

Just to explain why I use parameters in events (we have had this discussion some 10 years ago!) :
Most of the people for whom I implement a backup solution are aging home users.
Whenever something goes wrong during backup, most of them just won't see the blinking Reflector icon in the task bar.
It can sit there blinking for months and nobody will notice the backups don't work correctly anymore, for whatever reason.
Therefore, when %ERRORS > 0, I pop up a red colored window the user has to acknowledge.

Similarly, when the backup has to go to an external drive (most aging people don't trust clouds...), I use a pre-backup event to check whether the external drive is present:
If not, %ERRORS will be > 0 since Reflector can't reach the target directory, allowing me to pop up a warning window asking to plug in the external drive. If this does not happen within a script specified period of time, my script cancels the job.

Best regards,
Ronald
User avatar
cobian
Site Admin
Posts: 4537
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by cobian »

Can you tell me why is not %USERNAME working? What result are you getting ?
--
Luis Cobian
Cobian Backup's creator
User avatar
picdev
Posts: 11
Joined: 13 Dec 2021, 17:20

Re: %ERRORS and other parameters for Events non operational

Post by picdev »

Good morning and happy new year

I wanted to use the variables that are described in https://www.cobiansoft.com/crHelp/parameters.html when sending the emails reporting errors in the backup.

To test all the variables, I have put them in the body of the message and this has been the result:
- A group that has performed as expected, based on the descriptions of the variables.
- A group of 3 variables, very important, that have worked as literals, so they have not been useful to me.
- One last group, which simply has not worked as expected: they have not returned any value that allows working with them.

Is this the expected behavior, or is it that I have not understood anything at all?

Thanks in advance...



1) Variable substitution works correctly

Code: Select all

%APPDATA:             C:\Users\{{USER}}\AppData\Roaming - Path to the current user's application data directory
%APPLICATIONPATH:     C:\Program Files\Cobian Reflector - The path from which the program is being run
%CCFORMATDATETIME:    2022-01-04 10:00:01 - Format the current data and time using the option from the Alternative date-time format (Options/Advanced), using the current culture
%COMMONAPPDATA:       C:\ProgramData - Path to the common application data directory
%COMPUTERNAME:        PICSL-LAB2 - Substituted with the name of the computer
%COMPUTERNOSPACENAME: PICSL-LAB2 - Substituted with the name of the computer but any space in the name is eliminated
%DATENOTIME:          2022-01-04 - The current date, without the time
%DATETIME:            2022-01-04 10:00:01 - The current date and time
%DBPATH:              C:\Program Files\Cobian Reflector\DB - The path to the history database subdirectory
%DOMAINNAME:          PICSL - The domain of the logged in (actual) user
%ERRORS:              2 - Is substituted by the number of errors up to this moment
%FNCCFORMATDATETIME:  2022-01-04 10;00;01 - Format the current data and time using the option from the Alternative date-time format (Options/Advanced), but eliminating all the characters that are illegal in a file name. Uses the current culture
%FNDATENOTIME:        2022-01-04 - The current date without the time, but can be used directly as a file name
%FNDATETIME:          2022-01-04 10;00;01 - The current date and time, but can be used directly as a file name
%FNFORMATDATETIME:    2022-01-04 10;00;01 - Format the current data and time using the option from the Alternative date-time format (Options/Advanced), but eliminating all the characters that are illegal in a file name. Uses the invariant culture
%FNTIMENODATE:        10:00:01 - The current time without the date, but can be used directly as a file name
%FORMATDATETIME:      2022-01-04 10:00:01 - Format the current data and time using the option from the Alternative date-time format (Options/Advanced), using the invariant culture
%LISTSPATH:           C:\Program Files\Cobian Reflector\Lists - The path to the lists subdirectory
%LOCALAPPDATA:        C:\WINDOWS\system32\config\systemprofile\AppData\Local - Path to the current user's local application data
%LOCALSETTINGS:       C:\WINDOWS\system32\config\systemprofile\AppData\Local\CobianSoft\Cobian Reflector - The path to the settings subdirectories
%LOGSPATH:            C:\Program Files\Cobian Reflector\Logs - The path to the Logs subdirectory
%SETTINGSPATH:        C:\Program Files\Cobian Reflector\Settings - The path to the Settings subdirectory
%TIMENODATE:          10:00:01 - The current time, without the date
%USERNAME:            SYSTEM - The name of the account of the actual user
%USERPROFILE:         C:\WINDOWS\system32\config\systemprofile - Path to the current user's profile directory
2) The original variable appears as a literal

Code: Select all

%DEFAULTBODY:         %DEFAULTBODY - Use a default text for the mail body.
%DEFAULTSUBJECT:      %DEFAULTSUBJECT - Use a default string for the mail subject.
%DISKLABEL:           %DISKLABEL - The label of some volume that will be substituted by the actual volume letter.
3) These variables appear empty, without any content.

Code: Select all

%DESKTOP:             ¿? - Path to the current user's desktop
%DOCUMENTS:           ¿? - Path to the current user's document folder
%PERSONAL:            ¿? - Path to the current user's home directory
%PICTURES:            ¿? - Path to the current user's picture's folder
%TASKNAME:            ¿? - The name of the task that is being executed
%TASKNOSPACENAME:     ¿? - The name of the task that is being executed but any space is eliminated
%VIDEOS:              ¿? - Path to the current user's video folder
My 2¢ :-)
Frutchy wrote: 08 Nov 2021, 11:13 Hi Luis,

I'm sorry for the miswriting. I ment %ERRORS of course.
But it is not only this parameter that is concerned.
I have not tried them all, but a couple of them like %DATETIME, %USERNAME, %DOCUMENTS, %DISKLABEL, etc. and none of them works...

Reflector DOES start the bat files as usual, but they don't receive the parameter values.
As I wrote, it has probably to do with the way the executable files are registered and that it is not possible to edit.

Ronald
User avatar
cobian
Site Admin
Posts: 4537
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by cobian »

%DESKTOP: ¿? - Path to the current user's desktop
%DOCUMENTS: ¿? - Path to the current user's document folder
%PERSONAL: ¿? - Path to the current user's home directory
%PICTURES: ¿? - Path to the current user's picture's folder
%VIDEOS:

Will of course NOT work when running as a service under the System account. If that the case?
--
Luis Cobian
Cobian Backup's creator
User avatar
picdev
Posts: 11
Joined: 13 Dec 2021, 17:20

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by picdev »

It is the case, indeed ...

It makes sense ...

It would be nice to add that information to https://www.cobiansoft.com/crHelp/parameters.html to avoid someone else getting confused about this topic.

However, both TASKNAME and TASKNOSPACENAME should have content, whether it's running under the SYSTEM account or running under any other account, right?

I would like to build a message like this that works with any account:

"Task %TASKNAME, executed on %FNDATETIME, had %ERRORS errors."

... but at the moment, using the SYSTEM account, I can't seem to build it.

Also note that the variables %DEFAULTBODY, %DEFAULTSUBJECT and %DISKLABEL, which are variables that should not depend on the user with whom the program is run, show their literals, instead of the value they should contain.
Last edited by picdev on 07 Jan 2022, 10:44, edited 1 time in total.
User avatar
cobian
Site Admin
Posts: 4537
Joined: 31 Oct 2020, 01:25
Location: Sweden
Contact:

Re: %ERRORS and all other parameters for Events non operationalbat file

Post by cobian »

%TASKNAME and %TASKNOSPACENAME are working for me (of course, when they are available, for example, not in the mail test)

%DEFAULTBODY and %DEFAULTSUBJECT have no use but to have a subject and a body for those who don't care to change it.

%DISKLABEL is a little more tricky to use and its use is also limited: when you are using removable drives. %DISKLABEL="MyPlace":\autoexec.bat will be substituted by z:\autoexec.bat if the volume z: has the label MyPlace
--
Luis Cobian
Cobian Backup's creator
Post Reply