Opened 10 years ago

Closed 9 years ago

#4454 closed Bug (fixed)

Time Machine exclusion for partial download does not work on Lion

Reported by: matsw Owned by: livings124
Priority: Normal Milestone: 2.70
Component: Mac Client Version: 2.33
Severity: Normal Keywords: Lion Time Machine partial download
Cc:

Description

The mechanism that Transmission uses to exclude partial downloads from Time Machine backups does not work on Mac OS 10.7. It produces the following message in the system log:

Transmission[1453]: This process is attempting to exclude an item from Time Machine by path without administrator privileges. This is not supported.

and of course, the partial file is backed up by Time Machine.

Attachments (2)

transmission.diff (8.0 KB) - added by 0ptional 9 years ago.
transmission2.diff (6.5 KB) - added by 0ptional 9 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by livings124

  • Component changed from Transmission to Mac Client
  • Owner set to livings124

Changed 9 years ago by 0ptional

comment:3 Changed 9 years ago by 0ptional

I rewrote all of the Time Machine handling to fix this issue. The only Time Machine exclusions that non-admin users can set are sticky (they follow the file), so I removed all of the places where the exclusions were updated on file move. The exclusion is now only set when a new torrent is added, when the completion state changes, and when a torrent is removed. Torrents loaded from history are assumed to have been set when they were first added so no change is made to these torrents.

According to Apple's documentation (https://developer.apple.com/library/mac/#documentation/MacOSX/Reference/Backup/Reference/reference.html#//apple_ref/doc/uid/TP40004700) this api hasn't changed since 10.5, so my code should work for all OS's 10.5-10.8.

I am new to ObjC so let me know if there are any errors in my revision. A patch is attached.

(This should also fix ticket:1281)

comment:4 Changed 9 years ago by livings124

Thanks for the patch!

Have you verified that the url is still set correctly when a torrent is moved through the app? I was hesitant with fixing this because we don't always move files directly, but copy the file structure, which might not be compatible with this.

comment:5 Changed 9 years ago by 0ptional

Hmm. You're right. It doesn't work when moving the torrent (except single files on the same filesystem) because you don't preserve the extended attributes. I'll go back and have it reset the exclude flag when moving the files.

Changed 9 years ago by 0ptional

comment:6 Changed 9 years ago by 0ptional

Ok! Here's a new patch.

This is the logic used for Time Machine excludes in this patch:

  • Time Machine exclude status is explicitly managed for all torrents for as long as they are in Transmission.
  • Exclude status is set to the inverse of the completion state. (Only counting requested files)
    • Ex: A torrent in progress it is set to be excluded.
    • Ex: A completed torrent is set to be un-excluded.
    • Ex: A torrent with 2 files, but 1/1 requested/completed is set to be un-excluded.
  • Exclude status is (re)set when a torrent is added, loaded, moved, or changes completion state.
  • When a torrent is removed, its data is un-excluded (whether or not the download was complete)

This should be mostly the same logic as the original implementation, with the exception of resetting the state on load from history.

Let me know if you find any issues with this.

comment:7 Changed 9 years ago by livings124

Great, thanks for the patch!

comment:8 Changed 9 years ago by livings124

  • Milestone changed from None Set to 2.70
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.