I use the geany text editor, which has a command line option to list all open documents. The following command works fine when run from the command line:
/usr/bin/geany --list-documents > /home/myname/geanylist.txt
I want to run this regularly in cron, but it does not work. I have tried:
- putting the above command directly into my crontab
- wrapping the above command in a bash script, and calling that in my crontab
- defining all normal path and other environment variables in the script
- copying the entire contents of my .bashrc into the script
- redirecting stderr and stdout to a log file (no help)
No matter what I do, when the crontab runs, ~/geanylist.txt will not contain the output from
geany --list-documents, though it will contain any other output generated by the script. I am at a loss. How can I make this work? Is there another system utility besides cron I can use that will let me do this?
The best solution I can think of is to create a script with a loop that runs the command and then sleeps for 24 hours - surely there is a better way?
- The result of
/usr/bin/geany --list-documents, when run from the CL, is a list of full paths to (usually ascii txt) files, one per line, on stdout.
- When adding the command or script to my crontab, I use
crontab -e, with
nano. This is the same way I have added many other commands to my crontab, all of which work properly (none of these other commands attempt to run
geanyin any way).