HR

Hallo folks,

for creating a backup inside a report I have the following function DbBackup:

function DbBackup()
{
    var ADB   = ArisData.getActiveDatabase();
    var oFile;
    var oDbAdmin;
    var lOK;
    var sPath = "C:\\Download";
    var sFile = "WorkDB "+Date();

    Context.setSelectedPath(sPath);
    Context.setSelectedFile(sFile);
    oFile     = new java.io.File(sPath, sFile);
    oDbAdmin  = Context.getComponent("ServerAdmin");
    lOK       = oDbAdmin.backupDatabase(ADB, oFile);

    return;
}

 

This function runs through without creating an error.

But unfortunately it does not create any backup file and the answer of "oDbAdmin.backupDatabase(ADB, oFile)" is "false". (lOK = false)

The path "C:\Download" exists on my computer and I run the report on my local server for development.

When starting a backup of this database manually I have no problems. That works fine.

Now I would be very happy if anybody can help me and show me where my mistake is.

Many thanks in advance,

Holger

by Holger Reidemeister Author
Posted on Fri, 05/05/2017 - 09:42

OK, I found the solution myself. The mistake is the filename. Using Date() generates the filename "WorkDB Fri May 05 2017 09:32:45 GMT+0200 (MESZ).adb" and this can't be handled. The new line for generating the filename is:

var sFile = "WorkDB "+getTimeStamp()+".adb";

getTimeStamp() is an own function that gives back the current date and time in the format "YYYYMMDDhhmm" without any special chars like ":", "(", ")" and "+".

And so it works and I get my backup.

Many thanks to everyone who were thinking about.

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock