I have a virtual machine on a cloud host that stays running in non-desktop mode. It has the Cinnamon desktop environment installed, but I don't typically leave the desktop environment open.
I have a cron job I'd like to run every hour which requires opening an app which requires a desktop environment (headful Chrome).
I've been able to schedule the cron job to use the desktop environment by adding the DISPLAY
envvar in the job definition:
1 * * * * DISPLAY=:20 /path/to/script/to/execute
However, this only works when I use remote desktop software to open Cinnamon from my laptop.
I'd like to be able to leave the web server running, without having a remote desktop connection permanently open on my end, and run cron jobs that depend on a desktop environment.
Do y'all have a suggestion for running a cron job as I want to? Maybe a way to leave a desktop environment open without using a remote desktop? Or a way to open a desktop environment within a cron job?