6

I would like to be able to move files downloaded by transmission in the name of my primary user.

I added this user to the group debian-transmission, but it is not enough, only the owner has the write permission on the downloaded files.

So I see some possibilities:

  • changing the user of transmission, but that does not seem to be a good practice.
  • set an option in transmission to let it write a file with write permissions for the group, but I do not know if it is possible.

So what is your advice to lead to a good solution?

3 Answers 3

13
+50

The solution proposed by @sverker is good, but I suggest you change the configuration of transmission so that it changes the umask with which are written the downloaded files. The configuration is stored in

~/.config/transmission/settings.json

Find and change the "umask" value. Note that the json format uses decimal notation, so take a look at the table and find a value for the new umask (ex: 22)

Umask   Created Files       Created Directories
-------------------------------------------------------------
000     666 (rw-rw-rw-)     777     (rwxrwxrwx)
002     664 (rw-rw-r--)     775     (rwxrwxr-x)
022     644 (rw-r--r--)     755     (rwxr-xr-x)
027     640 (rw-r-----)     750     (rwxr-x---)
077     600 (rw-------)     700     (rwx------)
277     400 (r--------)     500     (r-x------)

then in a terminal:

#echo $((8#022)) 
18

Finally change the umask value to 18

4
  • +1 This! Changing the permission (and possibly group ownership) of the download directory as well as the umask of the Transmission daemon should result in write permissions for the owner group. Commented Feb 23, 2016 at 14:21
  • that sounds as a good solution. Commented Feb 23, 2016 at 17:44
  • Yep, that's better. No need to run scripts if we can get the solution from the start. Commented Feb 24, 2016 at 15:28
  • more details about umask: cyberciti.biz/tips/… Commented Jun 19, 2016 at 11:42
1

Transmission, at least as a daemon, has the option to run a script on completion of a torrent. You should be able to tell this script to chmod to 664 upon completion. From there, the files should be accessible, and writable from your main user. You could make a script that contains these lines:

#!/usr/bin/env bash    
chmod -R 664 ${TR_TORRENT_DIR}
exit 0

You then make that script executable, and place it somewhere where transmission-daemon can access it, like /usr/local/bin or something.

Then you tell transmission-daemon to run the script upon torrent completion. You can either do this by GUI, or to have this line in your /etc/transmission-daemon/settings.json file:

"script-torrent-done-filename": "/usr/local/bin/your-script.sh", 

And that should be that. The concept of the script-torrent-done is rather powerful, I use it to sort torrents into movies/music/etc according to its content, but that's a rather longer script :)

0

You should read up on ACL, it allows you to add additional permissions, like add permissions for your main user.

for e.g sudo setfacl -d -R u:gael:rw /home/transmission allows your user to read and write to that directory. -d is default which means files created in that directory will have those new permissions. Usually you use -m instead of -d. Run with -m to apply to existing files.

You could make a script to run the setfacl command on completion to ensure all files are correct, As Sverker suggested;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .