I use the Geany IDE for programming, and it does not reliably reload my previously open files, for example after a power outage. I found that Geany has a command line feature which returns a list of all open files in the editor, so I hoped that I could quickly write a cron command that would automatically save that list every hour or so.
I currently have this line in my crontab:
0 * * * * ~/bin/save_geany_files
and the script contains just one line:
geany --list-documents > ~/geany_files.txt
This does not work. I noticed that Geany's --list-documents feature must be called by the same user (I think), so I tried adding "su - [myusername]" to the script, but apparently su cannot be used from within a cron job? So, I am at a loss for how to automate this. I am open to any other solutions to my problem, although Geany options/plugins seem to be unreliable (which is why I tried this in the first place)