Southsoftware.com
   

Advanced Task Scheduler’s SQLite database

From version 5.0 and later Advanced Task Scheduler uses SQLite database file to store its settings and scheduled tasks.

You can find location and file name of SQLite database file in this topic: Scheduled Tasks location and upgrade compatibility.

For your convenience we have published SQLite Shell, which was built with the same options as Advanced Task Scheduler uses internally. You can download the shell here: sqlite.zip.

This topic covers a few examples of SQLite Shell commands that can be used to tune up Advanced Task Scheduler's functionality.

Do not forget to exit Advanced Task Scheduler and stop it's service before modifying database.

Dump history

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
SELECT datetime(actiontime, 'unixepoch', 'localtime'), errorcode, exitcode, (select name from tasks where tasks.guid=task_guid), actionschedule, actionsource, actionsourceextra, exelog FROM history ORDER BY actiontime DESC;

Clear history

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
DELETE FROM history;

Dump root groups

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
SELECT GuidToString(guid), type, name, icon, datetime(last_modified, 'unixepoch', 'localtime') FROM root;

Insert another local tasks group

This may be useful as root groups use their own settings such as log file and user account options.

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
INSERT INTO root(guid, type, name, icon, last_modified) VALUES (GuidCreate(), 0, 'Another local tasks', '', strftime('%s','now'));

Insert another replicated tasks group

This may be useful as root groups use their own settings such as log file, user account and replication options (Network Edition only).

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
SELECT GuidToString(GuidCreate());

The new GUID will be displayed. Use the following commands to create new replicated tasks group on the all machines where you want to use the same replicated group. The "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" should be replaced with the actual GUID that was returned on the previous step.

.open "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite"
.load "guidstring.dll"
INSERT INTO root(guid, type, name, icon, last_modified) VALUES (GuidFromString("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"), 1, 'Another replicated tasks', '', strftime('%s','now'));

In these examples "C:/ProgramData/Advanced Task Scheduler Network/allusers.sqlite" should be replaced with your actual file name and path; "guidstring.dll" is an SQLite Extension that is available from the package listed above.

Related Articles
Scheduled Tasks location and upgrade compatibility

Categories: Manual, Troubleshooting

   
About us   Cookie policy   Privacy policy   Terms of use   Link to us