[FreeNAS 9 Plugins] - SAB / SB / CP / HP / Maraschino / HTPC / Mylar / LL / Gamez

Status
Not open for further replies.

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
So take a snapshot and replicate it to another pool.

A snapshot is going to get you FAR more than some compressed file. Much less room for error too.

TAR is, but if you forget a single parameter of TAR, you could render your "backup" useless. Snapshots are the one and only way I recommend.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
So take a snapshot and replicate it to another pool.

A snapshot is going to get you FAR more than some compressed file. Much less room for error too.

TAR is, but if you forget a single parameter of TAR, you could render your "backup" useless. Snapshots are the one and only way I recommend.

You're thinking like a FreeNAS person / BSD person and not a Windows guy being paranoid.
I don't have another pool to replicate it to. I don't want to configure one.
If I tar up / compress the files (with the correct attributes) in a single file, it may not be a 100% sure fire backup but the odds are in my favour. I can then literally dump the file on my laptop or something.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
You don't have to have another pool to replicate to. Simply replicate to a file, then store that on your Windows box if you wish.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Thanks for the help, 9.3 has gone on, it was messy but it's working, I've set up routine jobs to make a snapshot once a day and last only 2 days, just in case.
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
So what is it they say about 2 steps forward and 1 step back? :)

I've found an elegant solution to my initial problem within rutorrent on my seedbox. There is a plugin called autotools that allows me to set up a folder structure as well as labelling and hard linking of finished files. If I duplicate that folder structure on my Freenas box and then use BTSync, I can have a fully automated system that ensued everything is kept separate. For example; Sickrage snatches a torrent and sends it to downloads/watch/TV BTSync then syncs that folder with downloads/watch/TV on my hosted seedbox. Rtorrent sees the torrent and downloads it to downloads/download/TV and then once completed, it hard links the file to downloads/complete/TV which is connected via BTSync to downloads/complete/TV on my Freenas box. I have Couchpotato doing the same with a /Movies structure and headphones with /Music

So problem solved, yes?

Not quite...

Post processing is no longer working! I get an error in the log saying 'the extracted file cannot be moved to the new destination'

The destination hasn't changed from the one I had working just hours before. The only thing that has changed is the location of the post processing folders and even then, they are now sub directories of the old post processing folder that was working fine before.

So that's where I am right now. I presume this is a permisions issue, but as the folder structure has hardly changed, I'm not sure why.

Any suggestions would be gratefuly received :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So what is it they say about 2 steps forward and 1 step back? :)

I've found an elegant solution to my initial problem within rutorrent on my seedbox. There is a plugin called autotools that allows me to set up a folder structure as well as labelling and hard linking of finished files. If I duplicate that folder structure on my Freenas box and then use BTSync, I can have a fully automated system that ensued everything is kept separate. For example; Sickrage snatches a torrent and sends it to downloads/watch/TV BTSync then syncs that folder with downloads/watch/TV on my hosted seedbox. Rtorrent sees the torrent and downloads it to downloads/download/TV and then once completed, it hard links the file to downloads/complete/TV which is connected via BTSync to downloads/complete/TV on my Freenas box. I have Couchpotato doing the same with a /Movies structure and headphones with /Music

So problem solved, yes?

Not quite...

Post processing is no longer working! I get an error in the log saying 'the extracted file cannot be moved to the new destination'

The destination hasn't changed from the one I had working just hours before. The only thing that has changed is the location of the post processing folders and even then, they are now sub directories of the old post processing folder that was working fine before.

So that's where I am right now. I presume this is a permisions issue, but as the folder structure has hardly changed, I'm not sure why.

Any suggestions would be gratefuly received :)
well permission problems should be easy enough to solve. get an 'ls -l' of those folders
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
well permission problems should be easy enough to solve. get an 'ls -l' of those folders

Sorry Josh, I'm not quite sure what you mean by 'ls - 1'


EDIT:
Apologies, I should have researched before responding. So it's a directory listing, but where do I run the command from?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Sorry Josh, I'm not quite sure what you mean by 'ls - 1'
I asking you list the ownership/permission of the files/folders in question. that's the command you would run
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Okay, so I have a mix of 816 (a user I added to get BTSync working) Root and nobody

I presume this mix of users, or lack of in nobody's case, is the cause?
I barely have enough information to help you but I'll try.

816 isn't a user, that's a UID. Normally assigned to the user 'media' that sickrage runs as by default.
sickrage needs to be able to write in the directories it's processing files from and too.

Use a solution from here to give sickrage the ability to write to those directories.
https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
Thanks Josh,

As these directories will need BTSync to access them and as I understand it BTSync needs a UID of 816, would it make the most sense to create a new user with the same UID and then recursively change ownership of the datasets I need to access to that new user?

I noticed option 4 on your link was simply 'Change permission of the data dataset/folder to allow other writing' am I correct in thinking this would be the least desirable option from a security perspective?

Apologies if some of my questions are stupid. Coming from a windows background, getting my head around Unix is taking a while
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
btsync doesn't need to (run) as a UID of 816, but that is one possible option to solve your problem. By default btsync runs as the user 'btsync' (UID=817).
One solution would be to add the media user (UID 816) to the btsync jail and have btsync run as this user (basically alternative 2).
Or, you could, in the sickrage jail, add a group with UID 817 and add the 'media' user to this group. This would allow sickrage to write/delete files based on on group permissions. (basically alternative 3)

Yup, alternative 4 is the least secure cause it gives everyone the ability to write files. It also may not solve the problem in this case depending on what permission level btsync writes new files as.
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
"One solution would be to add the media user (UID 816) to the btsync jail and have btsync run as this user (basically alternative 2)."

Okay, so I tried the above, following the instructions from your other thread:

  1. service PLUGIN onestop
  2. chown -R USER:GROUP /var/db/PLUGIN
  3. sysrc 'PLUGIN_user=USER'
  4. service PLUGIN start
using media:wheel as user and group

however when I try to restart btsync, I am getting the following error:

Starting btsync.
Can't open pid file /var/run/btsync/btsync.pid. Permission denied/usr/local/etc/
rc.d/btsync: WARNING: failed to start btsync



EDIT:

Ok, so I changed the user back to BTSync and I get a new error:

Starting btsync.
su: unknown login: BTSync
/usr/local/etc/rc.d/btsync: WARNING: failed to start btsync
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
"One solution would be to add the media user (UID 816) to the btsync jail and have btsync run as this user (basically alternative 2)."

Okay, so I tried the above, following the instructions from your other thread:

  1. service PLUGIN onestop
  2. chown -R USER:GROUP /var/db/PLUGIN
  3. sysrc 'PLUGIN_user=USER'
  4. service PLUGIN start
using media:wheel as user and group

however when I try to restart btsync, I am getting the following error:

Starting btsync.
Can't open pid file /var/run/btsync/btsync.pid. Permission denied/usr/local/etc/
rc.d/btsync: WARNING: failed to start btsync



EDIT:

Ok, so I changed the user back to BTSync and I get a new error:

Starting btsync.
su: unknown login: BTSync
/usr/local/etc/rc.d/btsync: WARNING: failed to start btsync
I forgot to mention you may need to delete the pidfile directory, you can do this between step 3 and 4.
Code:
rm -r /var/run/btsync


who is the BTSync user? This isn't Windows, everything is case sensitive.
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
I forgot to mention you may need to delete the pidfile directory, you can do this between step 3 and 4.
Code:
rm -r /var/run/btsync

Thanks, that line got it back up and working.

who is the BTSync user? This isn't Windows, everything is case sensitive.

BTSync was the user name I was advised to use when following a guide to set the plugin up


Hmmm, sickrage is still throwing the same error about not being able to move the files though:

Unable to move file /Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv to /TV shows SR/Broadchurch/Season 02/Broadchurch - S02E01 - Episode 1.mkv: [Errno 2] No such file or directory: '/Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv'
Processing failed for /Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv: Unable to move the files to their new home
Problem(s) during processing
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks, that line got it back up and working.



BTSync was the user name I was advised to use when following a guide to set the plugin up


Hmmm, sickrage is still throwing the same error about not being able to move the files though:

Unable to move file /Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv to /TV shows SR/Broadchurch/Season 02/Broadchurch - S02E01 - Episode 1.mkv: [Errno 2] No such file or directory: '/Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv'
Processing failed for /Downloads/Complete/TV/Broadchurch.S02E01.720p.HDTV.x264-FTP/Broadchurch.S02E01.720p.HDTV.x264-FTP.mkv: Unable to move the files to their new home
Problem(s) during processing
Can you show the permissions of /Downloads/Complete/TV?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
drwxr-xr-x 2 816 wheel 3 Feb 18 00:25 Vikings.S03E00.720p.HDTV.x264-NOPE
The folder you just posted is writable by sickrage because it is owned by 816.

The error you posted complained about the file missing. did the file ever download?
 

CraftyClown

Patron
Joined
Apr 5, 2014
Messages
214
That file moved ok in the end. The last of the troublesome files I moved manually as I believe part of the problem my have been, they were given permisions before I changed the BTSync user to a UID of 816

I did flag up another issue during this, actually more of a bad practice than an issue.

I noticed that many of my datasets are already set as 777. I believe I may have done this a long time ago, when trying to get my CIFS shares to work, as I access all of these volumes daily via windows.

Seeing as this Freenas box is used purely as my home entertainment system and sits behind a VPN, is this still something I should worry about?

I tested the theory just now and removed some of the permissions and lo and behold, my samba share lost write access.

EDIT:

crap, crap, crap crap!!!!!!!!!!

While I was tinkering around with dataset permissions, I accidentally applied a recursive permissions change to my plugin jails!!! and after a reboot of Freenas, none of them will turn on

I have a sick feeling in my stomach now. Have I just toasted them?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
That file moved ok in the end. The last of the troublesome files I moved manually as I believe part of the problem my have been, they were given permisions before I changed the BTSync user to a UID of 816

I did flag up another issue during this, actually more of a bad practice than an issue.

I noticed that many of my datasets are already set as 777. I believe I may have done this a long time ago, when trying to get my CIFS shares to work, as I access all of these volumes daily via windows.

Seeing as this Freenas box is used purely as my home entertainment system and sits behind a VPN, is this still something I should worry about?

I tested the theory just now and removed some of the permissions and lo and behold, my samba share lost write access.

EDIT:

crap, crap, crap crap!!!!!!!!!!

While I was tinkering around with dataset permissions, I accidentally applied a recursive permissions change to my plugin jails!!! and after a reboot of Freenas, none of them will turn on

I have a sick feeling in my stomach now. Have I just toasted them?
don't do that. I think you already knew that though.

I suggest you..
* install second instances of those plugins in whatever number of jails you want
* do any changes you did to make permissions match (I think your chosen solution was to have btsync use the 'media' user)
* copy over your datadirectories (/var/db/PLUGIN), this will save you from reconfiguring your plugins
* mount in your dataset(s)
* start your new plugins, if everything works delete your old plugins.
 
Status
Not open for further replies.
Top