Automatic cloning of tmairlist database

Hello mairlist gurus :wink: !
I’m trying to run an automated DB backup using a script. I got the script from this post : Clone Database (an old post which seems still valid). I just modified the target path to suit my needs.
I’m using the Professional studio version, i.e. with a PostGRE engine.

I’m getting this error message : error running script: [error] (16:4): invalid number of parameters.

Can anyone help me ?

Thanks,

Philippe

Hei!
Can you please post your script, and leave out/replace your credentials? :blush:

Op de volgende manier maak ik een backup van de database in een draaiend systeem.
Uiteraard aanpassen aan jouw behoeften… doe er je voordeel mee…

Verberingen lees ik ook graag terug


@Echo Off
D:
CD
CD “D:\mAirlist DB”
for /f “tokens=2 delims==” %%a in (‘wmic OS Get localdatetime /value’) do set “dt=%%a”
set “YY=%dt:~2,2%” & set “YYYY=%dt:~0,4%” & set “MM=%dt:~4,2%” & set “DD=%dt:~6,2%”
set “HH=%dt:~8,2%” & set “Min=%dt:~10,2%” & set “Sec=%dt:~12,2%”
set “fullstamp=%DD%-%MM%-%YYYY%_%HH%.%Min%”
timeout /t 10 /nobreak
copy “mAirList DB.mldb” “mAirList DB.mldb.%fullstamp%.bu”
del “mAirList DB.mldb”

Pas het aan en sla het op als backup-ml-db.bat



const
COMMAND = ‘C:\Scriptjes\mairlist-scripts\backup-ml-db.bat’;
begin
Database(0).SetEnabled(false);
CopyFile(‘D:\Database\mAirList DB.mldb’, ‘D:\mAirlist DB\mAirList DB.mldb’, true);
Database(0).SetEnabled(true);
ShellExecutehidden(‘cmd.exe’, ‘/c’ + Chr(32) + COMMAND);
end.

Pas het aan en sla het op als backupdb.mls


Groet ,
ROn

1 Like

Here is the script :

begin
CloneDatabase(
IDBConnection(Database(0)), // Connection
‘sqlite’, // TargetType
‘’, // Host, empty for sqlite
‘X:\RCM-backup.mldb’, // Database, or Filename for sqlite
‘’, // User, empty for sqlite
‘’, // Password, empty for sqlite
false, // Include icons?
true, // Include playlist?
0, // day from which to include playlists, 0 = all
true, // Include history?,
0, // day from which to include history, 0 = all
‘’, // new database ID, empty = use existing
nil // progress indicator, always use nil in scripts
);
end.

Well it is, as you said before, mainly the same script als given in the link above. However, if you read that topic further down, there is a post

Unfortunately it doesn’t come out why it does (or doesn’t) so. It should be evaluated if @Torben ’s script does work in the first place.