Ok, I got this working well enough. I used user level crontab:
Code:
52 11 * * 0 DISPLAY=:0 gnome-terminal -e /home/bob/Documents/scripts/calibre-update.sh
Adjust path and times accordingly.
The script contains:
Code:
#!/bin/sh
sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"
When it runs, a terminal will appear, with a prompt for password. If you want to be insecure and expose the password, and avoid the prompt, you can use:
Code:
echo "your-system-password"|sudo -S python ...etc...