Jump to content

2.0.4 loses all torrents if computer halts


rd

Recommended Posts

A brief power outage caused 2.0.4 to lose all torrents. It looks like resume.dat is bad.

I suggest that this file is not left open. And instead of writing directly to it, write to a another file and then rename the new and old files.

I need to set the current directory for hundreds of torrents now. A batch find & set feature would be nice right now.

Link to comment
Share on other sites

µTorrent already does attempt to do that. That's exactly what resume.dat.old is for. Windows caches the writes apparently, which screws this up...

In Windows you can close the file or force the write. On Linux, you're SOL as the kernel lies about forced writes.

FWIW, the old file was timestamped the same as the current file. So I'm guessing uTorrent on startup happily overwrote the old file.

Link to comment
Share on other sites

I have same problem with loosing files after failure. Unfortunately it seems Win XP disk cache problem.

After saving file disk cache writes only part of file (file has still old size) and waits long time to write it completely.

When file is saved you have failure before disk cache writes it completely then you have data loss.

Its WinXP cache problem that waits even a few minutes (too long in my opinion) to write a file.

Win98 cache seems to be better in this as I didn't have so much data loss when failure.

I know that in XP it's possible to turn off write cache to reduce damage:

System properties>Hardware>Device manager>disks>get properties of your disk>Rules>uncheck write buffer

Text on your system might be slightly differ as I translate it from my language to english.

Unfortunately when write buffer is turned off then I can see write speed on my HDD is lowered

from ~24MB/s to ~8MB/s so is consideration speed vs data integrity.

uTorrent writes RESUME.DAT every minute so RESUME.DAT.OLD is 2 minutes old.

Thing you can do is make more backup copies so if newest is not yet written you still have older.

Simple BACKUP.BAT code to make 6 backup copies would look like this:

- yesterday I posted it, but this one is corrected with additional check for RESUME.DAT existence

so backup is not overwritten when it does not exist:

@ECHO OFF

ECHO This .BAT file should be run in uTorrent settings directory:

ECHO %AppData%\uTorrent

IF NOT EXIST RESUME.DAT GOTO FAIL

IF EXIST RESUME_5.DAT COPY RESUME_5.DAT RESUME_6.DAT

IF EXIST RESUME_4.DAT COPY RESUME_4.DAT RESUME_5.DAT

IF EXIST RESUME_3.DAT COPY RESUME_3.DAT RESUME_4.DAT

IF EXIST RESUME_2.DAT COPY RESUME_2.DAT RESUME_3.DAT

IF EXIST RESUME_1.DAT COPY RESUME_1.DAT RESUME_2.DAT

IF EXIST RESUME.DAT COPY RESUME.DAT RESUME_1.DAT

GOTO END

:FAIL

ECHO RESUME.DAT does not exist - backup skipped.

PAUSE

:END

REM CLS to make DOS window close automatically

CLS

Just use task scheduler to run it minimized in background for example every minute or 2.

Or BACKUP2.BAT using rename - less disk writes (also corrected):

@ECHO OFF

ECHO This .BAT file should be run in uTorrent settings directory:

ECHO %AppData%\uTorrent

IF NOT EXIST RESUME.DAT GOTO FAIL

IF EXIST RESUME_6.DAT REN RESUME_6.DAT RESUME_7.DAT

IF EXIST RESUME_5.DAT REN RESUME_5.DAT RESUME_6.DAT

IF EXIST RESUME_4.DAT REN RESUME_4.DAT RESUME_5.DAT

IF EXIST RESUME_3.DAT REN RESUME_3.DAT RESUME_4.DAT

IF EXIST RESUME_2.DAT REN RESUME_2.DAT RESUME_3.DAT

IF EXIST RESUME_1.DAT REN RESUME_1.DAT RESUME_2.DAT

IF EXIST RESUME_7.DAT REN RESUME_7.DAT RESUME_1.DAT

IF EXIST RESUME.DAT COPY RESUME.DAT RESUME_1.DAT

GOTO END

:FAIL

ECHO.

ECHO RESUME.DAT does not exist - backup skipped.

PAUSE

:END

REM CLS to make DOS window close automatically

CLS

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...