“tput: No value for $TERM and no -T specified ” error logged by CRON process

Something in the script is calling the tput binary. tput attempts to inspect the $TERM variable to determine the current terminal so it can produce the correct control sequences. There isn’t a terminal when cron is running so you get that error from tput. You can either manually assign a TERM value to the cron … Read more

Difference between * and ? in Spring @Scheduled(cron=”…..”)

The tutorial is outdated. The symbol ? means exactly the same as the symbol *. As of Spring version 3.1.2.RELEASE, the call hierarchy is the following: The constructor CronTrigger(String) calls the constructor CronSequenceGenerator(String) CronSequenceGenerator(String) calls parse(String) parse(String) calls setDays(BitSet bits, String field, int max). Its implementation is clear: private void setDays(BitSet bits, String field, int … Read more

Why ssh fails from crontab but succeeds when executed from a command line?

keychain solves this in a painless way. It’s in the repos for Debian/Ubuntu: sudo apt-get install keychain and perhaps for many other distros (it looks like it originated from Gentoo). This program will start an ssh-agent if none is running, and provide shell scripts that can be sourced and connect the current shell to this … Read more

How can I get the URL (with protocol and domain) in Django (without request)?

TL;DR: There’s no any “standard” “Django-ish” way of doing that, but the DRY principle promoted by the framework assumes the single configuration store, so a custom setting seems to be a good way to go. By default Django can serve any number of domains from a single instance, and the HTTP request (more accurately, its … Read more

Will Cron start a new job if the current job is not complete? [duplicate]

They’ll run at the same time. The standard practice around this is to create a file lock (commonly referred to as a flock), and if the lock isn’t available, don’t run. The advantages to this over Zdenek’s approach is that it doesn’t require a database, and when the process ends, the flock is automatically released. … Read more