Page 1 of 1

chown script

Posted: September 21st, 2010, 12:15 pm
by stabu
Im trying to make a chown script for sabnzbd i have a .sh file that has "chmod -R usernamehere $1 but it will not run.

Re: chown script

Posted: September 21st, 2010, 2:01 pm
by rascalli
how does it need to chmod  ???
There is no value set .. like 777 or 755 or whatever

Re: chown script

Posted: September 24th, 2010, 10:24 am
by stabu
oops i ment chown

Re: chown script

Posted: September 24th, 2010, 11:07 am
by rascalli
normally chown command is done like this in linux :

chown usernamehere:usernamehere -R $1

Re: chown script

Posted: September 24th, 2010, 11:44 am
by jcfp
Changing file ownership is privileged, i.e. your script won't work unless sab runs as root. Probably better to just start the application as the user you want to own the downloaded files.

Re: chown script

Posted: September 25th, 2010, 7:39 am
by stabu
its running as root, thats the problem. Im running sabnzbd on freenas and trying to get the permissions set for users. If I download something with sabnzbd its always locked to root.

Re: chown script

Posted: October 9th, 2010, 9:48 pm
by Darqfallen
I had a similar issue, Sabnzbd is running on another device but ultimatly the files are trasnfered to my freenas box for storage. What you could do is create a scripts directory on your freenas box and have cron run it every 5 minutes.
The script then sets the owner of the download directory for you every 5 mintues.

Something like below

Code: Select all

#!/bin/bash
chmod -R 777 /mnt/*
chown -R newuser:wheel /mnt/*
That makes anyone able to read the files from /mnt on. Change that to suit your needs.

I actually run this script every 5 seconds because I am impatient.