Save session data for crash recovery.

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Post by *avada »

Dalai wrote: Yeah, well, that's where you don't get my point. I think that it won't help in most cases, only in some cases in which the data has been written to disk correctly.
I think you're just plain wrong then. Lots of apps have well functioning crash recovery.

Also, I already mentioned that there are secure ways to write data.
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: Save session data for crash recovery.

Post by *avada »

sirsilver wrote:first you start by CLAIMING
And that's as far as I read, since it became obvious you're the same person who was blocked. I won't waste my time for another round of you flawed logic/reasoning,thinly veiled hostility and arrogance.

Even worse, you're the kind of troll who gets more glib as you argue about your non-points.
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Post by *avada »

Hacker wrote:
cm_ConfigSaveSettings
Yup, that one is very useful. I don't think it would hurt anyone if there was an ini option AutoSaveSettingsEveryXMinutes=10.

Roman
That'd be cool. Isn't there a trick to call that function periodically?
Hacker wrote:Dalai,
I think that it won't help in most cases
I don't get it. If a system crashes, say, once a week, and TC saves its config every ten 10 minutes for half a second, why do you assume that in most cases the system crashes exactly during those 0,5 seconds while TC is saving its config? All else being equal, the chance of this happening is 1:1200.

Roman
Not to mention that corruption can be avoided.
Dalai wrote:In short: if you really want to make sure that TC saves your settings you have to force the system to flush the file-system buffer (only TC's data of course), thus writing the data to disk. Otherwise you can't be sure it really gets there correctly (uncorrupted). To make one thing clear: I'm not talking about the cache of the drive/disk itself, only the OS's buffer/cache. If the data is still on the drive's cache, it's out of TC's, and even the OS's, hand.
:shock: It's like you're trying to make fun of yourself. You've been complaining about one thing for several posts, and now you just point out that there's a solution to that and that it's a non-issue.

@Sir_SiLvA You're a diligent troll, I'll give you that. Though you lack even basic sense. (And apparently reading comprehension)
User avatar
Dalai
Power Member
Power Member
Posts: 9598
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

avada wrote:Lots of apps have well functioning crash recovery.
Crash recovery is a different thing than just saving the settings file at intervals. I just wanted to point out that just saving wincmd.ini probably won't achieve much because the OS decides when to write it to disk, unless you force it to do so (and at this point, I don't know if it can be done). You have to know how the system works/behaves before making a concept of some auto-save/crash recovery/backup or whatever you call it.

Also, there are different concepts/mechanisms to avoid data-loss, but you have to think about which of them is best suited for the matter at hand beforehand. Yes, in the end, Ghisler has to do it, but the users can take part in it, can't they? And that's what I've done.
You've been complaining about one thing for several posts, and now you just point out that there's a solution to that and that it's a non-issue.
I just said that that's the way TC (or any other program) would have to take. I don't know if such a function exists and whether it can be used in this case, if it would make things better or not. That's not so difficult to understand, is it?

[EDIT] Fixed typo [/EDIT]

Regards
Dalai
Last edited by Dalai on 2016-06-13, 14:41 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Stefan2
Power Member
Power Member
Posts: 4275
Joined: 2007-09-13, 22:20 UTC
Location: Europa

VBS: WINCMD.INI_Backup.VBS, backup the INI every x minutes

Post by *Stefan2 »

If my system would crash, I would utilize my system tools to help me out:

WINCMD.INI_Backup.VBS

Code: Select all


'On Error Resume Next
'//Purpose: create an copy of 'WINCMD.INI' every x minutes.
'//Put this script as text file 'WINCMD.INI_Backup.VBS' in TC folder and launch it.
'//Create a text file 'WINCMD.INI_Backup.NO' in TC folder to stop this script from executing.
'//Delete 'WINCMD.INI_Backup.NO' and launch 'WINCMD.INI_Backup.VBS' to run it again.
'-----------------------------------------------------------------------------------
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
Const Seconds  = 1000       '// 1000ms=1Second
Const Minutes  = 60000      '// 60*1000=1Minute
Const HalfHour = 180000     '// 1800*1000=1/2hour 
Const Hours    = 3600000    '// 3600*1000=1hour
Const HalfDay  = 43200000
Do While(true)
    N = Now
    'W = WeekdayName( Weekday(N), true)
    D =  Year(N) &"-"& Right("00" & Month(N), 2) &"-"& Right("00" & Day(N), 2)
    T = Right("00" & Hour(N), 2) & Right("00" & Minute(N), 2) & Right("00" & Second(N), 2)
    FSO.CopyFile "WINCMD.INI",  "WINCMD.INI - Kopie " & D &"_"& T & ".INI"
    If fso.FileExists ("WINCMD.INI_Backup.NO") Then WScript.Quit
    Wscript.Sleep 2*Hours      '//SLEEP in milliseconds 
Loop


Result:
WINCMD.INI
WINCMD.INI - Kopie 2016-06-13_130007.INI
WINCMD.INI - Kopie 2016-06-13_150007.INI
WINCMD.INI - Kopie 2016-06-13_170007.INI
WINCMD.INI - Kopie 2016-06-13_190007.INI
...
WINCMD.INI_Backup.no
WINCMD.INI_Backup.VBS




 
User avatar
Hacker
Moderator
Moderator
Posts: 13136
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

avada,
That'd be cool. Isn't there a trick to call that function periodically?
This AHK script should tell TC to save its settings every 10 minutes (600000 ms):

Code: Select all

#Persistent
#NoEnv

SetTimer, SaveTcSettings, 600000
Return

SaveTcSettings:
	PostMessage, 1075, 580, , , ahk_class TTOTAL_CMD
Return
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Post by *avada »

So, is some level of crash recovery considered?
Windows 10
User avatar
Phred
Senior Member
Senior Member
Posts: 375
Joined: 2009-06-16, 15:24 UTC
Location: SEAu

Re:

Post by *Phred »

Hacker wrote: 2016-06-13, 14:21 UTC avada,
That'd be cool. Isn't there a trick to call that function periodically?
This AHK script should tell TC to save its settings every 10 minutes (600000 ms):

Code: Select all

#Persistent
#NoEnv
SetTimer, SaveTcSettings, 600000
Return
SaveTcSettings:
	PostMessage, 1075, 580, , , ahk_class TTOTAL_CMD
Return
HTH
Roman
Speaking from the future, I thought I'd try implementing this for my interest and for that of others.

I have AutoHotkey installed. That should be self-r'searchable.

To get this code running I chose 'SELECT ALL' and copied the code, then in plain Notepad pasted it and saved it as TCAutoSave.ahk - that avoided Notepad's wish to save it as a .txt file, putting it in "D:\Users\Public\Downloads\Applets\".

AutoHotkey.exe itself sits in the "D:\Users\Public\Downloads\Applets\AutoHotKey\" folder (I don't operate as an administrator). Having run it previously and having any file with the .ahk suffix 'captured' by the association of them to AutoHotkey, I double-clicked on TCAutoSave.ahk to execute it. The background green 'H' symbol of AutoHotkey appeared over in the Notification Area.

TCAutoSave is running now behind this window, every 10 minutes, turning my TC item on my Taskbar orange (saying that a background execution event occurred); curious, but inoffensive. Just why it's running, I can't quite see, there being no obvious, to me, pointers to TC itself in the code. TC's current .ini IS being saved, so it must be operating.


FWIW, long ago I implemented a Button Bar button for the internal cm_ConfigSaveSettings command using the '=' equals sign as its icon, signifying 'make saved settings equal to the current settings'. It does the same thing as Alt, Configuration, Save settings. I use it in the same way I used to instruct spreadsheet users: save after every thought. Every change of settings, in this case. I don't save tabs, preferring to start TC with my fixed set. I do the opposite with browsers, saving my last session.
It would be a simple operation to assign a Button Bar button to this .ahk script, as an alternative.
HTH

[I saved this text progressively in Spartan Standard (free) clipboard during composition.]
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: Re:

Post by *avada »

Phred wrote: 2020-10-10, 15:43 UTC FWIW, long ago I implemented a Button Bar button for the internal cm_ConfigSaveSettings command using the '=' equals sign as its icon, signifying 'make saved settings equal to the current settings'. It does the same thing as Alt, Configuration, Save settings.
I though setting cm_ConfigSaveSettings for alt+tab might work as a workaround. But apparently TC doesn't get a chance to capture it.
Windows 10
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Re:

Post by *gdpr deleted 6 »

avada wrote: 2020-11-12, 17:40 UTC I though setting cm_ConfigSaveSettings for alt+tab might work as a workaround. But apparently TC doesn't get a chance to capture it.
An Alt+Tab key event is normally not sent to an application, but directly handled by Windows. To process Alt+Tab, an application would need to install a hook procedure. Funnily enough, despite not hooking Alt+Tab (<== my bold assumption based on shallow, surface-level observations), TC allows to define a (non-functional) Alt+Tab hotkey. :)
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: Re:

Post by *avada »

elgonzo wrote: 2020-11-12, 19:50 UTC
avada wrote: 2020-11-12, 17:40 UTC I though setting cm_ConfigSaveSettings for alt+tab might work as a workaround. But apparently TC doesn't get a chance to capture it.
An Alt+Tab key event is normally not sent to an application, but directly handled by Windows. To process Alt+Tab, an application would need to install a hook procedure. Funnily enough, despite not hooking Alt+Tab (<== my bold assumption based on shallow, surface-level observations), TC allows to define a (non-functional) Alt+Tab hotkey. :)
I know. I tried. :)
Also, unfortunately it also doesn't work if another app is using it as a global hotkey. I would have expected both bot reacting to it. Oh well, so much for the idea of adding it as a commonly used keyboard combination.
Windows 10
Post Reply