1

I am using the following command to update my TeXLive 2019 installation on Ubuntu (installed it from CTAN, not packages) on a weekly basis to keep my packages reasonably up to date:

sudo /usr/local/texlive/2019/bin/x86_64-linux/tlmgr update --self -all

This works as expected, even when called using a shell script (sudo /root/bin/updatetexlive):

#!/bin/bash

/usr/local/texlive/2019/bin/x86_64-linux/tlmgr update --self -all

However, when I invoke this using cron (sudo crontab -e):

20 23 * * sun /root/bin/updatetexlive

(Every Sunday at 11:20 PM.)

I get the cryptic error:

Unable to download the checksum of the remote TeX Live database, but found a local copy, so using that.

You may want to try specifying an explicit or different CTAN mirror, or maybe you need to specify proxy information if you're behind a firewall; see the information and examples for the -repository option at https://tug.org/texlive/doc/install-tl.html (and in the output of install-tl --help).

tlmgr: package repository http://ctan.math.utah.edu/systems/texlive/tlnet (not verified: u nknown) tlmgr: saving backups to /usr/local/texlive/2019/tlpkg/backups

As a matter of general rule, when something fails in cron when it works on the command line, usually an environment variable related to the calling shell is at fault. So, I looked in my list of export's on the commandline, and found three possible variables. I set them in the crontab:

PATH="/usr/local/texlive/2019/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
TEXMFDIST="/usr/local/texlive/2019/texmf-dist"
SHELL=/bin/bash

However, I still get the error above. How do I make tlmgr run as a cron job?

1 Answer 1

0

It was a proxy issue. Needed to set the http_proxy, http_proxy and ftp_proxy variables to the right values (in crontab), and it worked.

http_proxy=http://10.22.31.1:3128
https_proxy=https://10.22.31.1:3128
ftp_proxy=ftp://10.22.31.1:3128

Note that you have to specify the full URL for this to work.

Updating your tex database on a regular basis using a cron job should be the recommended standard operating procedure on Linux/Unix/Mac OSX installations.

1
  • 1
    On single user machines I try and be very careful about when I update TeX. If I have a deadline on Monday, I sure as heck don't want to update and break something on Sunday night.
    – StrongBad
    Dec 26, 2019 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .