Scheduler won't run custom CBU script

What a relief to discover CBU for Win7 after ntbackup has been removed since WinXP. Thank you!

I have managed to follow the reference at Comodo Help to create my own weekly full backup and daily incremental backup scripts using CBU. These script run perfectly from the command line. When I set up two schedules in Win7 “Task Scheduler”, Sat runs the full backup script, Sun-Fri runs the incremental script, they start but they do not complete. The last incremental script returned a result of 0x800704DD. The last full backup script returned a result of 0x5C and an email with “Backup “\Files\backup_full_01_01_2011.cbu” failed with code 92”.

The backups can be quite large, the full backup was about 8.7 GB and the incremental about 1.3 GB, and they span both local discs and a network disc mounted as a drive letter. I tested the scripts on a smaller data set using the network mounted drive and these ran, inclusing from the scheduler (using right click “run”), but the full backup set only works fro mthe command line. I know that CBU can set up scheduled tasks, but that’s only good if you specify the scheduled task within CBU and I want it scripted in a .cmd file for my convenience to change.

The scripts are included here for inspection, and I am happy to receive advice on how I could better use the tool. The intent is they run during the night when users may or may not be logged on to the PC. Is there any reason why the scheduler is unable to run these scripts?

Thanks!

Philip

=== Comodo_Full_Backup.cmd ===

[at]echo off

rem On-line help on Comodo Backup
rem Comodo Help
rem On-line help on command line options
rem Comodo Help

set backup_path=\Files
set backup_path_last=\Last_Week
rem The file specification to list in the search for the last backup file.
set spec=backup_*.cbu

rem If the directory for last week exists
rmdir /s /q “%backup_path_last%” > nul
rem Create sub-directory for last weeks backups
mkdir “%backup_path_last%”
rem Move last weeks backups in
move “%backup_path%*” “%backup_path_last%”

rem Create a new full backup

rem For testing
rem set sources=“U:\website”
rem For real
set sources=“U:\website|U:\shared|U:\home|C:\inetpub\wwwroot|C:\Users”

set backup_dest_file=“%backup_path%\backup_full|DATE1|.cbu”

“C:\Program Files\Comodo\Comodo BackUp\CBU.exe” ^
/backup_operation ^
/type filesandfolders ^
/source %sources% ^
/exclusionfilter “.tmp|.bak|Thumbs.db” ^
/compressionlevel high ^
/description “Daily Scheduled Backup - Full” ^
/destinationtype destinationtypediskfile ^
/destinationpath %backup_dest_file% ^
/backup_type full ^
/compressionlevel medium ^
/diskusage high ^
/processorusage high ^
/locked_files_treatment vss ^
/emailnotification ^
/onsucces ^
/onfailure ^
/smtpserver xxxx.xxxxxx.org.uk ^
/port 25 ^
/subject “Weekly Full Backup” ^
/sender backup[at]xxxxxx.org.uk ^
/recipient me[at]xxxxxx.org.uk ^
/emailusername “xxxxxx” ^
/useSSL 0 ^
/guiRunModeServiceModeRun ^
/silentRun

=== Comodo_Incremental_Backup.cmd ===

[at]echo off

rem On-line help on Comodo Backup
rem Comodo Help
rem On-line help on command line options
rem Comodo Help

rem For testing
rem set sources=“U:\website”
rem For real
set sources=“U:\website|U:\shared|U:\home|C:\inetpub\wwwroot|C:\Users”

set backup_path=\Files
rem The file specification to list in the search for the last backup file.
set spec=backup_*.cbu

rem Find the newest file in the directory meeting the required file format
for /F "tokens=1 delims= " %%f in (‘dir “%backup_path%%spec%” /a-d /od /b’)

do set backup_last_file=“%backup_path%%%f”

rem Name for the file to be created, including Comodo filename macros
set backup_dest_file=“%backup_path%\backup|INCREMENTAL_NO||DATE1|.cbu”

“C:\Program Files\Comodo\Comodo BackUp\CBU.exe” ^
/backup_operation ^
/type filesandfolders ^
/source %sources% ^
/exclusionfilter “.tmp|.bak|Thumbs.db” ^
/description “Daily Scheduled Backup - Incremental” ^
/destinationtype destinationtypediskfile ^
/destinationpath %backup_dest_file% ^
/backup_type incremental ^
/parent_backup_storage_type destinationtypediskfile ^
/parent_backup_path %backup_last_file% ^
/compressionlevel medium ^
/diskusage high ^
/processorusage high ^
/compressionlevel medium ^
/diskusage high ^
/processorusage high ^
/locked_files_treatment vss ^
/emailnotification ^
/onsucces ^
/onfailure ^
/smtpserver xxxx.xxxxxx.org.uk ^
/port 25 ^
/subject “Weekly Full Backup” ^
/sender backup[at]xxxxxx.org.uk ^
/recipient me[at]xxxxxx.org.uk ^
/emailusername “xxxxxx” ^
/useSSL 0 ^
/guiRunModeServiceModeRun ^
/silentRun

Hi

Please remove
/guiRunModeServiceModeRun ^
/silentRun

This way you will be able to see the log of the backup process. And we can determine the exact cause.
Error code 92 means no content. In other words there is nothing to backup.

Thanks

This way you will be able to see the log of the backup process. And we can determine the exact cause.

I’m not so sure! ;D

The scripts run fine (except for the occasional error 59 as probably explained by https://forums.Comodo.com/help-cb/error-code-59-t66807.0.html) from the command line. The problem only occurs when you go to the “Task Scheduler”, and then all sorts of oddities creep in. For example, one I have teased out tonight is that any task I create to run my script must not be set to “Run whether user is logged on or not”. I must use the “Run only when the use is logged on” option, which removes the possibility of unattended backups in the middle of the night when sysadmin has logged off and gone to bed.

Why would CBU.exe object to this setting? My other scripts don’t, but they only run DOS utils.

Another observation is that when using “Run only when the use is logged on”, I see the cmd.exe shell appear to execute my script. When using “Run whether user is logged on or not” I do not. This would indicate that execution environment is quite different in the latter and might explain why no content could be found and hence error 92 reported. Does that sound plausible?

Hi

Error 92 means no content (nothing to backup).
Most likely because user is not logged on. What exactly are you trying to backup?
For unattended backups use “ServiceMode” run. These backups will run even if no one is logged on.

PS: Mapped network drives are visible only while user that mapped them is still logged on.

Thanks

For unattended backups use "ServiceMode" run. These backups will run even if no one is logged on.

Ahem! See original post, and then then the following one where you asked me to drop “Service Mode”. Obviously my results were obtained in Service Mode!

PS: Mapped network drives are visible only while user that mapped them is still logged on.

I can see the sense, but does reduce the point of Service Mode completely for me. I’m only using a mapped network drive because your GUI at least does not support “\server\share”. But I dare say that too would require the user to be logged in. Given that Task Scheduler was running the task as “Administrator” and even stored the Administrator password with the job I would have expected the script to be run in an appropriate execution environment where that user was effectively logged on.

At least ntbackup.exe for WinXP managed to work properly when setup from the Task Sceduler and provide me with unattended backups when no one was logged in. So I guess this is a feature request? It certainly should be possible, but obviously you don’t support this.

Hi philipa

You can use task to run before backup in backup step 5 to run a windows script file (*.bat) to map the network location as virtual drive.
This will resolve the problem.

Thanks

U: is the network mapping in the script originally posted. As this is always mapped for the user chosen as the task owner in Task Scheduler (i.e. run as “HOST\Administrator”) is should already be mapped when task scheduler runs the task. I could map it a second time and have two drives pointing to the same place… but why? That adds a second, potentially flakey dependency on the temporary mapping suceeding.

I’m think that there is an issue with your software being configured to run from a script manually set up in Task Scheduler, I simply point out that this was never an issue with ntbackup.exe under WinXP. Maybe your software does not support this, maybe Windows 7 no longer supports this? I don’t think your replies offer senisble suggestions, or really make use of the information so far provided.

Philip