tlmulti
The tlmulti command allows tlmenu to be successively run on multiple databases.
tlmulti requires a list of database names to use. By default, it looks for a $REALROOT/files/tlmulti_dbases file, containing one database per line, where REALROOT is the base root for the system.; alternatively, you can specify another list file that contains the same information. The databases can be in different instances and tlmulti will handle the switch from one instance to another automatically.
tlmulti requires a logs subfolder which it will create within the current folder if not already present. The logs subfolder will contain tlmulti_database log files, one for each database processed by the command (any existing log files for these databases are removed).
Syntax
tlmulti {-v} {-s} {-f{p|s|b}} {-a listfile} script-file
tlmulti {-f{p|s|b}} {-a listfile} -l
tlmulti {-v} {-s} {-f{p|s|b}} {-a listfile} -m
tlmulti {-v} {-f{p|s|b}} {-a listfile} -d database {script-file}
Options
-f {p|s|b} Restrict the operation of the command to primary databases (p), secondary databases (s) or both (b) primary and secondary databases. Defaults to primary databases if not specified.
-a listfile An alternate file of database names, to be used instead of the tlmulti_dbases file.
-l List the databases in the tlmulti_dbases file, or in an alternate listfile if specified.
-m Resume monitoring the log files (if tlmulti is interrupted).
-s Skip the first database in the tlmulti_dbases file, or in an alternate listfile if specified. You will typically want to do this if the first database in the file has already had the commands in the script-file run against it.
-v Verbose mode; the tail of each tlmulti_database log file is periodically displayed on screen.
-d database Run tlmenu on database first, and then prompt to repeat for the databases in the tlmulti_dbases file or in an alternate listfile if specified.
script-file A script produced by a previous tlmulti -d or tlmenu record command.
Operation
-
Use tlmulti -l to check which databases are currently listed in the tlmulti_dbases or listfile file.
-
If a script file already exists use tlmulti script-file to run that script on all the databases in the tlmulti_dbases or listfile file.
-
If a script file does not exist you can use tlmenu record script-file database to create one and then, assuming that the database mentioned is the first one listed in the tlmulti_dbases or listfile file, use tlmulti -s script-file to process the rest of the databases in that file.
-
Alternatively, you can instead use tlmulti -d database which runs tlmenu but does not explicitly create a script file unless you also identify a script-file in which it can be permanently recorded. When tlmenu finishes you are prompted:
Repeat the above on all databases [y/n]?
Pressing Y causes tlmulti to process the other databases in the tlmulti_dbases or listfile file in exactly the same way. If a script file is produced it can then be re-applied to another list of databases.
-
By default tlmulti selects only primary or standalone databases from the list. Use the -f switch to select only secondary databases or both primary and secondary databases.
-
Once tlmulti has begun processing the tlmulti_dbases or listfile file it monitors the log files checking for script completion. Periodically tlmulti displays the databases on which it is waiting.
-
When tlmulti detects the log file for a database is complete it displays the tail of that log file and then prompts:
Database database appears to have finished. Hit RETURN to continue:
Pressing RETURN causes tlmulti to move to the next database in the tlmulti_dbases file.
-
If tlmulti is interrupted during the log monitoring phase (by pressing Ctrl-C) it can be restarted monitoring logs by using the -m option.