Geany: Automatically remove autosaved backup after closing file (gio_unsafe_save_backup method)
by tauro_kpo from LinuxQuestions.org on (#5A2M1)
Hi,
I want a backup/autosave feature like vim has (by default). So I was reading the Geany wiki article on autosaving (All you never wanted to know about file saving)[1]... and it's unexpectedly inconvenient.
I have chosen to use "gio_unsafe_save_backup" because I think it's the best alternative, since it's not overwriting the original file and uses the same directory, but...
After closing the file in the editor, the backup just stays there.
Is there a way to automatically delete the backup once I press 'Save' or close the editor?
The "Backup Copy" option is interesting, but it uses a fixed directory (like /tmp), and creates multiple files over time (from a single file). If only there was an option to create a single backup of each file and that it gets overwritten in a specified interval, and then deleted after manually saving or closing...
Is there any Geany whiz out here that could help?
If there's not an organic way to solve this, perhaps I should see if I can run a script that automatically deletes the file, right after I close the file in the editor.
Thank you.
[1] https://wiki.geany.org/config/all_yo...ut_file_saving


I want a backup/autosave feature like vim has (by default). So I was reading the Geany wiki article on autosaving (All you never wanted to know about file saving)[1]... and it's unexpectedly inconvenient.
I have chosen to use "gio_unsafe_save_backup" because I think it's the best alternative, since it's not overwriting the original file and uses the same directory, but...
After closing the file in the editor, the backup just stays there.
Is there a way to automatically delete the backup once I press 'Save' or close the editor?
The "Backup Copy" option is interesting, but it uses a fixed directory (like /tmp), and creates multiple files over time (from a single file). If only there was an option to create a single backup of each file and that it gets overwritten in a specified interval, and then deleted after manually saving or closing...
Is there any Geany whiz out here that could help?
If there's not an organic way to solve this, perhaps I should see if I can run a script that automatically deletes the file, right after I close the file in the editor.
Thank you.
[1] https://wiki.geany.org/config/all_yo...ut_file_saving