[OxS] Administration toos via CLI

Hello all,

How difficult would it be to implement the Administration tools via CLI (such as php tools/cleardatacache.php, php tools/cleartemplatecache.php, php tools/clearscheculedexecutiontasks.php, php tools/endallusersessions.php)??

These would make a nice addition for command-line automation of the backup process we’re working on.

Hi @ramon,

These would be relatively quick and easy scripts. However, flushing the data and template caches can already be accomplished easily from the command line by removing all files from cache and cache/t_compile, respectively. Ending user sessions can be accomplished by removing all records from the sessions database table.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

Our new team member Alexandre, who is quite an accomplished programmer, but has no experience with OJS yet, is studying the automation process and has a few questions.

The one that worries him the most is the clearDataCache function (which seems to be solve via command line deletion of files anyway). He wonders what the $userDAO → flushCache(); really is doing in the database, if anything.

He is always concerned with data integrity in the database.

The scheduledTasks is also running a rmtree command, which removes everything and could also be run via command line.

Hi @ramon,

The call to UserDAO::flushCache is used to flush the ADODB library’s data cache, which is kept in cache/_db/. This is only a part of a data cache flush; the most important part is removing all .php files from cache/.

Removing all records from the sessions table won’t cause problems with data integrity.

Regards,
Alec Smecher
Public Knowledge Project Team