forked from plexguide/PlexGuide.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02 - RClone Install
103 lines (81 loc) · 3.04 KB
/
02 - RClone Install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
################# RClone ################# START
### RClone is utilized to move files automatically to your Google Drive
# Install unzip
sudo apt install unzip
# Download RClone and Rename
cd /tmp
sudo curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
sudo unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
# Move RClone to Bin for fututure execution
sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone
# Updates Man Pages
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb
# Deletes uncessary files
cd .. && sudo rm -r rclone*
# Sets file permissions for RClone folder
sudo mkdir /mnt/rclone
sudo chmod 755 /mnt/rclone
sudo chown root /mnt/rclone
# Configure RClone config as Root
sudo su
rclone config
### Configuring RClone
# N < For New remote
# gdrive < for the name
# 8 < For Google Drive (double check the number select incase)
# Enter Your Google ID
# Enter Your Goole Secret
# N < for headless machine
# Enter Your Verification Code
# Note: If you copy and paste by SELECTING and CLICK the RIGHT Mouse button, it will work; but then you will see it repeat
# Note: Hold the DEL button to del the extra crap and then paste into a browser to get the verfication code
# N < Configure this as a team drive?
# Y < If asking all is ok?
# Q < to quit
# Editing the fuse.conf file
nano /etc/fuse.conf
# remove the (#) symbol before user_allow_other
# Press CTRL+X and then save
### create script for the service
sudo nano /opt/rclone.sh
##### START COPY #####
#!/bin/bash
sudo rclone --allow-non-empty --allow-other mount gdrive: /mnt/rclone --config /root/.config/rclone/rclone.conf --bwlimit 8650k --size-only
exit 0;
##### END COPY #####
### create rclone service
# You are now creating the service that will allow it to restart
sudo nano /etc/systemd/system/rclone.service
### Copy the info inbetween from start to end into the file
##### START COPY ##### Note: ExecStart Line is ONE WHOLE LINE, it's wrapping
[Unit]
Description=rclonemount
After=multi-user.target
[Service]
ExecStart=/bin/bash /opt/rclone.sh
ExecStop=/bin/bash /opt/rclone.sh
Restart=on-abort
[Install]
WantedBy=multi-user.target
##### END COPY #####
# Press CTRL+X and then Yes to save
### Start and enable the service
sudo systemctl daemon-reload
sudo systemctl enable rclone.service
sudo systemctl start rclone.service
sudo systemctl status rclone.service
# Go back to your username - if you get stuck; you can reboot and test with the following lines below
# You can avoid the reboot and open a second terminal and see if the following below executes
exit
################# RClone ################# END
################# Final Notes ################# START
### Test by following the line below
cd /mnt/rclone && dir
# Something should come up - make sure you have something in your google drive to see/test it.
# If you have something in your google drive and either shows up blanks, it's because your configs were wrong or startup script is wrong
################# Final Notes ################# End