[BETA] Mostly automated ACD, Rclone, crypt, Plex, nzbget, PP Scripts

In short, yes, the script will create a new user (whatever you define in the “vars” file) and will add that user to the sudoers file, granting them sudo privileges, BUT it will also modify the ssh config file to prevent the actual ‘root’ user from logging in and it also prevents any user from logging in with a username/password, instead requiring SSH keys.

I’ve been working on the Wiki with step-by-step guides (with screenshots). The later software installs are still in progress, but the “setup” stuff is all documented!

Chris,
Thanks for the reply. I can see you’ve been busy. Last I checked… the Wiki was … well somewhat sparse :slight_smile: … I just hit your Wiki now… and well… damn you’ve been busy. The Wiki looks great.
I’m going to give it a run through now.
Thanks again.
Keep up the good work.

1 Like

Thanks!

Yeah, I had to take some time off but I hope to get back and complete the wiki this week.

Hi Chris,

Any chance of a script to auto-mount a drive at boot on an existing setup?

Thanks!

Well it depends on the system and the setup, but if you’re using a fairly standard setup with a Systemd system, then this should work:

  • create the file /etc/systemd/system/rcloneMount.service

  • with the following contents:
    #!/bin/bash rclone mount \ --read-only \ --allow-non-empty \ --dir-cache-time 1m \ --contimeout 15s \ --low-level-retries 1 \ --no-check-certificate \ --quiet \ --retries 3 \ --stats 0 \ --timeout 30s \ $RCLONE_REMOTE: /PATH/TO/$MOUNTPOINT &

  • Replace $RCLONE_REMOTE with the actual name of the remote you created with Rclone

  • Replace /PATH/TO/$MOUNTPOINT with the actual path where you want the remote mounted.

  • Reload systemd via: sudo systemctl daemon-reload

  • Start/stop the services via: sudo systemctl start cloneMount.service or sudo systemctl stop cloneMount.service

  • Once you’ve verified it starts properly, Start at boot: sudo systemctl enable cloneMount.service

Awesome! I’ll give that a try when I get home.

Hi Chris!
Great scripts as Ive said before.
Say do you have any ‘post processing scripts’… stuff like an uploadTV.sh ? Something that might run after your NZBGET downloads, unpacks, renames the file. Then your post-processing script would be called and push the file to the appropriate rcrypt’ed folder on ACD?

Thanks

Yeah, the scripts create upload*.sh scripts that nzbget calls:

#######################################
### NZBGET POST-PROCESSING SCRIPT   ###

# Rclone upload to Amazon Cloud Drive

# Wait for NZBget/Sickrage to finish moving files
sleep 10s

# Upload
rclone move -c $LOCALDIR $ACD:/$DIR/

# Tell Plex to update the Library
wget http://localhost:32400/library/sections/$THE-PLEX-SECTION-ID-YOU-WANT-REFRESHED/refresh?X-Plex-Token=$YOUR-PLEX-TOKEN

# Send PP Success code
exit 93
EOF

$LOCALDIR - the local directory you want to move to Amazon Cloud Drive.
$ACD:/$DIR/ - the rclone endpoint + the directory you want to move things into (acd:/movies)
$THE-PLEX-SECTION-ID-YOU-WANT-REFRESHED - every library has a “section ID”. You can find it from the browser. Log in to Plex, open one of your libraries and you’ll see it in the URL.
$YOUR-PLEX-TOKEN - is the Plex API token needed for authentication

In my scripts, all of these variables are created or applied from the vars file for you.

I just wanted to say that I just completed the wiki and this project is now in what I’d call a working beta state!

I’ve tested all of the scripts and wiki guides on a brand new Linode Ubuntu 16.04 without error. I’d love for others to do the same.

Now that the basic documentation is done I’ll start looking at adding additional software options and trying to automate even more of the process.

If anyone ever has any suggestions or recommendations I’d be happy to hear them either here, via email, or on github.

HUGE thanks to @ncw for all the hard work on rclone!

1 Like

Fantastic work, i’ve tested almost all your scripts with a clean VPS Ubuntu, and fight with errors, dependencies and all is working now, thanks!!

My suggestions to improve the procedure

1.- add install and enable network-online service as mount depends on it
2.- as the installation is from scratch, i would also add some other packages in the 00-SETUP as unzip, nano and some basics, that in a clean installation are not already installed.
3.- add google drive as an option
4.- Add plex update script

For the future:
Add monitoring tool for network, cpu, … like vnstat and others… to report usage of the resources of the server.
Add backup script to protect all the config and replicate to the cloud (Amazon/Google)

In any case thanks for your work!!

2 Likes

Just wanted to throw my 2 cents in here.

I also loaded up a fresh VPS with Chris’s scripts. Aside from my own blundering, his scripts work great. Makes life very easy to get up and running.

Great work Chris!

Thanks so much for these scripts, I’ve mostly muddled through from a Windows host, which adds some complexity, but now a bit stuck at the Couch Potato page…

I think the reason is; I can’t see in the documentation an good explanation of what our folders are for and where things should be written to.

Could you please explain the AMZ, AMZe, LOCAL, ALL etc.

The Couch Potato page states to add your library as “/home/$username/$encrypted/movies” Looking at VARS "encrypted is AMZe, there is no \movies folder in there, I can’t access it from CLI either. (Permission Denied, no user/group shown, just ?)

There is a \movies folder over at \ALL and \LOCAL

Once I get my head around what folder does what, I’m sure I’ll work it out.

Also, is the copy (rclone?) to ACD automatic, or is it user-triggered? Bit hazy on that part too!

Many thanks, once again.

EDIT: Reboot seems to have re-connected the AMZe folder, can now access. However, still no \movies folder in there. Happy to create, but, since there is a \movies in other folders, I’m not 100% I’m using the correct path. Please advise.
EDIT EDIT: It wasn’t the reboot that fixed the mount, I was SU, which does not allow me access to AMZe. FYI

I’m traveling for work right now so I apologize for the brief reply, but the wiki has a brief rundown of how everything works together.

Hopefully that answers some of your question. In short, my scripts create the /movie , /tv, etc folders wherever they need to be. If you’re not using the scripts then sure you can create the directories yourself.

I hope that helps.

Which VPS is everyone using for this?

I’ve only tested with Linode for now so I’d love to hear if anyone is using something else as well.

Ultimately, I’d like to find a group of people using this so that we can run some tests and compare notes. Discuss things like VPS quality, preferred/optimized settings, pull in @Ajki’s awesome knowledge etc. Since anyone using these scripts should have a nearly identical setup it gives us a baseline

Which Linode package do you recommend?

I wrote the wiki and tested the scripts with the Linode 4GB ($20/month) tier.

4 GB RAM
2 CPU Cores
48 GB SSD Storage
3 TB Transfer
40 Gbps Network In
250 Mbps Network Out

How many plex streams can you get from it?

I’ve had up to 4 so far with no issue, a combination of direct play and transcoding.

Thats impressive!!!