qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.22k stars 3.97k forks source link

Auto Change File Permissions When Finished #8016

Closed zero77 closed 1 month ago

zero77 commented 6 years ago

Can you please add the option to automatically change the file permissions of the downloads once they have been removed. Thanks

chibicitiberiu commented 5 years ago

I would also like to request this feature. Right now, I am using qbittorrent-nox on a server, and it is a bit of a pain that I can't modify any files.

As a workaround, you can set this script to run on torrent completion:

#!/bin/bash

# Update permissions
find "$1" -type f -exec chmod 666 -- {} +
find "$1" -type d -exec chmod 777 -- {} +

Enable 'run external program on torrent completion' option in settings, and set it to: /bin/bash /path/to/script.sh "%F"

Dapennsta commented 4 years ago

Another alternative could be to set the default permissions of the downloads directory. New files created in the directory will inherit these permissions. More info can be found here

From the article:

chmod g+s <directory>  //set gid 
setfacl -d -m g::rwx /<directory>  //set group to rwx default 
setfacl -d -m o::rx /<directory>   //set other

And verify the defaults with:

getfacl /<directory>

Output:

# file: ../<directory>/
# owner: <user>
# group: media
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

It would be nice to also have USER/GROUP control as well but that can be easily automated with a script.

eegeeZA commented 4 years ago

You can also configure Run external program on torrent completion to have:

chmod -R 770 "%F/"
zero77 commented 4 years ago

@eegeeZA @Dapennsta @chibicitiberiu Thanks

blorby commented 1 year ago

You can also configure Run external program on torrent completion to have:

chmod -R 770 "%F/"

2023 and that's still a great hack/solution while the application still can't set up permissions after downloading :)

n3wtype commented 2 months ago

It's even not so great, as it permits execution of downloaded files. It should be implemented properly within a client.