Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was executing a long Mathematica Notebook over night. The Mathematica instance is running on a Linux workstation (in a vnc server session to be precise). Now I cannot access this session anymore, which means that I likely loose the output data which was produced during the run. I can still login on the workstation as the same user and run Mathematica there. I know from the process list that Mathematica is still running, but I cannot access the GUI anymore. So, if there would be a remote control for Mathematica from command line or a second worksheet, which allows me to save the worksheet, I could prevent the data loss. I already tried to run a second instance of Mathematica but it seems that I cannot even see the Kernels there. Any ideas? It would save my day.

share|improve this question
    
That's why I always write the results of my long calculations to a file. Export[...,"file.mx.gz"] is your friend. Doesn't help you now, I know... –  Ajasja Jan 23 at 20:18
    
Oh, for next time, there is also NotebookAutoSave. –  Ajasja Jan 23 at 20:20
    
I'm afraid there's no good solution here. I've been looking into accessing already running kernels on remote machines to examine and change their state a couple of years ago. If you don't already have some setup to enable this, then I don't think it's worth spending any more effort. Just re-run the calculation next time you can access the machine and make sure the results are saved at the end of the calculation using Export. –  Szabolcs Jan 23 at 20:44
    
Oh, and beware of .mx! It's not cross platform or cross-version. Never keep important data in .mx. An cross-platform, cross-version alternative is to Compress your expressions and write the resulting string into a file. I use zimport[filename_] := Uncompress@Import[filename, "String"]; zexport[filename_, data_] := Export[filename, Compress[data], "String"] –  Szabolcs Jan 23 at 20:45
    
Ok, guys thanks for the hints. What's your experience with the NotebookAutoSave feature? Is it stable? My experience with other software is that it may crash while saving, especially if the files are big. It can then leave the files in an inconsistent/partial state. –  highsciguy Jan 24 at 10:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.