asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 297 forks source link

backup! enhancement request / proposal #631

Open newbie-02 opened 3 months ago

newbie-02 commented 3 months ago

I didn't find anything about backupping in AsciidocFX than requesting it at 'AsciidocFx 1.5.6 truncated my adoc file # 334'.
I managed to loose some data when something hit my keyboard and typed endless '+++++++++++++++++++++++++++++++++++++++++...', and can think of plenty situations where e.g. accidentally marking an area and deleting when typing together with AsciidocFX's 'auto save on leaving window' could cause harmful and - AFAIK - unrecoverable data loss.

Proposal: automatically create backup files on every write, mark them with date and time, and always keep one from the last 15 minutes, up to three for every last hour, up to three for every last day, ( up to three for every last week, up to three for every last month. ) Make it optional and on by default.

newbie-02 commented 1 month ago

just to underline importance ... had month of work without problems ...
and today: a 400k adoc file showed up empty, on disk 0 bytes. Can't say what's
the root, complexity?, encrypted drive? can say that I was lucky that I did a backup
yesterday, but 12 hrs are lost. :-( Think I'd been much happier if AsciidocFX had
simply copied the file to xxxxx.adocbak[date_time] on start ... better algos welcome.

rahmanusta commented 1 month ago

Thanks for the feature request. For more features it requires more sponsors https://opencollective.com/asciidocfx

newbie-02 commented 1 month ago

while nothing better available a short batch as a crutch:

stay sure not to have the names in the batch as files or directories around,

rm -r adoc_backup_07  
mv adoc_backup_06 adoc_backup_07 
mv adoc_backup_05 adoc_backup_06 
mv adoc_backup_04 adoc_backup_05 
mv adoc_backup_03 adoc_backup_04 
mv adoc_backup_02 adoc_backup_03 
mv adoc_backup_01 adoc_backup_02 
mkdir adoc_backup_01 
cp -p *.adoc adoc_backup_01 

will keep you 7 steps backup of all *.adoc files in that directory, call once a day or after heavy work ...

own risk, no warranty of any kind!!!