Is there a plugin for Eclipse which would automatically save the eclipse workspace every say 5 minutes in the background because every time eclipse crashes the entire workspace layout reverts or open files gets lost, and it is quite annoying at this point.
To save the layout, just change everything the way you like and then restart. Eclipse won't corrupt its prefs after a crash, so this should work. As an additional step, you can save the current perspective under a different name and export the prefs to a file. You can then load this file in case of a disaster.
I don't have a solution for the lost files issue, though.
Windows -> Preferences -> General -> Workspace
There is a box for the "Workspace save interval". But I am not sure that this is the thing you're looking for.
I'm not aware of any Eclipse plugins that do this, but for devs familiar with Eclipse plugin development it shouldn't be too hard to create a plugin that does this. Example code and info from here:
It is possible for your plug-in to explicitly request a workspace save or snapshot. If you are writing an RCP Application, you are responsible for minimally invoking save before shutdown. The following example saves the workspace:
final MultiStatus status = new MultiStatus(...);
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
try {
IWorkspace ws = ResourcesPlugin.getWorkspace();
status.merge(ws.save(true, monitor));
} catch (CoreException e) {
status.merge(e.getStatus());
}
}
};
new ProgressMonitorDialog(null).run(false, false, runnable);
if (!status.isOK())
ErrorDialog.openError(...);