Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Backup Date & Time..
Sun, Aug 4 2019 11:45 PMPermanent Link

Ian Branch

Avatar

Hi Team,
I have been using the following without issue for some time.
{sql}
   DBSBackup.Execute('BACKUP DATABASE "DBiWorkflow" AS "DBiWorkflow-Manual Backup-' + Engine.DateToSQLStr(Date)+ '" TO STORE "Backups" COMPRESSION 9 INCLUDE CATALOG');
{sql}

I want to now include the time.
I tried the following but it gives and error..
{sql}
   DBSBackup.Execute('BACKUP DATABASE "DBiWorkflow" AS "DBiWorkflow-Manual Backup-' + Engine.DateToSQLStr(Date)+ ' ' + Engine.TimeToSQLStr(Date)+'" TO STORE "Backups" COMPRESSION 9 INCLUDE CATALOG');
{sql}
Thoughts suggestions if you would be so kind.

Ian
Mon, Aug 5 2019 3:14 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


1. Please include the error - it helps

2. I think it will be the time format - it includes : which is not allowed in file names

3. It won't do what you want anyway - have a look at the Date function in Delphi - the time portion will always be 00:00 - use Now instead

Roy Lambert
Tue, Aug 6 2019 3:02 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
This worked..
{sql}
   DBSBackup.Execute('BACKUP DATABASE "DBiWorkflow" AS "DBiWorkflow-Manual Backup-' + FormatDateTime('yyyy-mm-dd @ HHnn', now) +
     '" TO STORE "Backups" COMPRESSION 9 INCLUDE CATALOG');
{sql}
Turned out the issue was the ':' being inserted into the Time.  The .tmp file was being created OK but wouldn't convert to .Bkp.

All sorted.  Thanks for the pointer/suggestion.
Regards,
Ian
Tue, Aug 6 2019 4:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian

>Turned out the issue was the ':' being inserted into the Time. The .tmp file was being created OK but wouldn't convert to .Bkp.

Weird - I would have expected the .tmp file to object as well - good old Windows Smiley

Roy
Image