I started to use latexmk to compile to pdf. The command I use is
latexmk -lualatex -jobname="LUA" -silent index.tex
Since my latex files are very large, it takes about 4-6 hrs to compile to pdf (some are over 60,000 pages) and requires 2-3 runs each time. Here is one example run which is still running for hrs now
latexmk -lualatex -jobname="LUA" -silent index.tex
Rc files read:
NONE
Latexmk: File-database 'LUA.fdb_latexmk' is of incompatible version, 3 v. current version 4
Latexmk: Run number 1 of rule 'lualatex'
This is LuaHBTeX, Version 1.15.1 (TeX Live 2023/dev)
restricted system commands enabled.
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'LUA.log'
Latexmk: Run number 2 of rule 'lualatex'
This is LuaHBTeX, Version 1.15.1 (TeX Live 2023/dev)
restricted system commands enabled.
Latexmk: fls file doesn't appear to have been made.
Latexmk: Getting log file 'LUA.log'
Latexmk: Run number 3 of rule 'lualatex'
This is LuaHBTeX, Version 1.15.1 (TeX Live 2023/dev)
restricted system commands enabled.
My question is this: Is it possible to make a backup file of the pdf file generated after each run before starting the next run, naming it say LUA_backup.pdf? (Because once a new run starts, the PDF file from the last run is erased automatically).
This way I can view the backup file (even if it not the final version) while waiting for the final version to be completed which will take many hrs more?
I used to do that before, when I was using my own script, but now since I switched to using latexmk I do not know how to do that. I looked at Latexmk options, but do not see one, so thought to ask maybe there is and I overlooked it.
TL 2022
>latexmk --version
Latexmk, John Collins, 18 Nov. 2022. Version 4.78
>which latexmk
/usr/local/texlive/2022/bin/x86_64-linux/latexmk
>

lualatexin the default value of $lualatex by the name of your script. The script would run lualatex and then copy the pdf file. That would be the simplest solution if you already has a script that does what you want or can be easily modified for the current situation. I've done this sort of thing on occasion. – John Collins Jan 06 '23 at 20:18