Ideas - Tdrive trash empty code | PlexGuide.com

Ideas Tdrive trash empty code

  • Thread starter MrDoob
  • Start date
  • Replies 10
  • Views 2K
  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now
M

MrDoob

Guest
Original poster
Hey we can implemented this one

I test if two weeks. and it works great !!

Here the code below

Bash:
rclone delete tdrive: --drive-trashed-only --drive-use-trash=false --verbose=1
Here the output of the deleting.

Code:
[email protected] /mnt/tdrive # rclone delete tdrive: --config /opt/appdata/plexguide/rclone.conf --drive-trashed-only --drive-use-trash=false --verbose=1
2019/05/07 18:46:42 INFO  : Waiting for deletions to finish
2019/05/07 18:50:24 INFO  : Movies/Batman Begins (2005)/Batman Begins (2005) CD1.mkv: Deleted
2019/05/07 18:51:42 INFO  : Movies/Bright (2017)/.fuse_hidden0025ea4700000004: Deleted
2019/05/07 18:51:48 INFO  : TV Shows/Shameless (US)/Season 09/Shameless (US) - S09E02 - Mo White.mkv: Deleted
2019/05/07 18:52:07 INFO  : TV Shows/The 100/Season 05/The 100 - S05E04 - Pandora's Box.mp4: Deleted
2019/05/07 18:52:07 INFO  : TV Shows/The 100/Season 05/The 100 - S05E01 - Eden.mp4: Deleted
2019/05/07 18:52:07 INFO  : TV Shows/The 100/Season 05/The 100 - S05E02 - Red Queen.mp4: Deleted
2019/05/07 18:52:07 INFO  : TV Shows/The 100/Season 05/The 100 - S05E03 - Sleeping Giants.mp4: Deleted
2019/05/07 18:52:08 INFO  : TV Shows/The 100/Season 05/The 100 - S05E06 - Exit Wounds.mp4: Deleted
2019/05/07 18:52:08 INFO  : TV Shows/The 100/Season 05/The 100 - S05E05 - Shifting Sands.mp4: Deleted
2019/05/07 18:52:08 INFO  : TV Shows/The 100/Season 05/The 100 - S05E08 - How We Get to Peace.mp4: Deleted
2019/05/07 18:52:08 INFO  : TV Shows/The 100/Season 05/The 100 - S05E07 - Acceptable Losses.mp4: Deleted
2019/05/07 18:52:09 INFO  : TV Shows/The 100/Season 05/The 100 - S05E10 - The Warriors Will.mp4: Deleted
2019/05/07 18:52:09 INFO  : TV Shows/The 100/Season 05/The 100 - S05E11 - The Dark Year.mp4: Deleted
2019/05/07 18:52:09 INFO  : TV Shows/The 100/Season 05/The 100 - S05E12 - Damocles.mp4: Deleted
2019/05/07 18:52:09 INFO  : TV Shows/The 100/Season 05/The 100 - S05E09 - Sic Semper Tyrannis.mp4: Deleted
2019/05/07 18:52:10 INFO  : TV Shows/The Batman/Season 02/The Batman - S02E11 - Grundy's Night.mkv: Deleted
2019/05/07 18:52:11 INFO  : TV Shows/The 100/Season 5/The 100 - S05E01 - Eden.mkv: Deleted
2019/05/07 18:52:11 INFO  : TV Shows/The 100/Season 5/The 100 - S05E02 - Red Queen.mkv: Deleted
2019/05/07 18:52:12 INFO  : TV Shows/The 100/Season 05/The 100 - S05E13 - Damocles.mp4: Deleted
2019/05/07 18:52:12 INFO  : TV Shows/The Batman/Season 03/The Batman - S03E11 - Thunder.mkv: Deleted
2019/05/07 18:52:12 INFO  : TV Shows/The Batman/Season 03/The Batman - S03E12 - The Icy Depths.mkv: Deleted
2019/05/07 18:52:12 INFO  : TV Shows/The Batman/Season 02/The Batman - S02E12 - Strange Minds.mkv: Deleted
2019/05/07 18:52:13 INFO  : TV Shows/The Batman/Season 02/The Batman - S02E13 - Night and the City.mkv: Deleted
2019/05/07 18:52:14 INFO  : TV Shows/The Batman/Season 03/The Batman - S03E13 - Gotham's Ultimate Criminal Mastermind.mkv: Deleted
2019/05/07 18:52:34 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E02 - Dancing Flowers.mkv: Deleted
2019/05/07 18:52:34 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E01 - New Surge.mkv: Deleted
2019/05/07 18:52:36 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E03 - Hangman.mkv: Deleted
2019/05/07 18:52:36 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E04 - Deeper Layers.mkv: Deleted
2019/05/07 18:52:36 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E01 - Neue Kraft.mkv: Deleted
2019/05/07 18:52:36 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E02 - Blütentanz.mkv: Deleted
2019/05/07 18:52:36 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E05 - Rift.mkv: Deleted
2019/05/07 18:52:37 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E06 - Thousand Paths.mkv: Deleted
2019/05/07 18:52:37 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E08 - Old Nines.mkv: Deleted
2019/05/07 18:52:37 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E07 - Permeation.mkv: Deleted
2019/05/07 18:52:37 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E09 - City in Waiting.mkv: Deleted
2019/05/07 18:52:38 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E12 - Ken.mkv: Deleted
2019/05/07 18:52:38 INFO  : TV Shows/Tokyo Ghoul/Specials/Tokyo Ghoul - S00E03 - Jack.mkv: Deleted
2019/05/07 18:52:38 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E10 - Last Rain.mkv: Deleted
2019/05/07 18:52:38 INFO  : TV Shows/Tokyo Ghoul/Season 02/Tokyo Ghoul - S02E11 - Deluge of Flowers.mkv: Deleted
2019/05/07 18:52:39 INFO  : TV Shows/Tokyo Ghoul/Specials/Tokyo Ghoul - S00E04 - Pinto.mkv: Deleted
2019/05/07 18:52:48 INFO  : Movies/Das Imperium schlägt zurück (1980)/Das Imperium schlägt zurück (1980).mkv: Deleted
 
M

MrDoob

Guest
Original poster
If we dont want a trash folder

We must add this code to the rclone command

Bash:
--drive-use-trash=false
FYI @Admin9705

Can you proof *?*

------------

Deleting files

By default rclone will send all files to the trash when deleting files. If deleting them permanently is required then use the

Code:
--drive-use-trash=false
flag, or set the equivalent environment variable.
 

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,112
sure, i bookmarked and can test this weekend.
 
M

MrDoob

Guest
Original poster
Here my tdrive.service commands

cd /etc/systemd/system
cp tdrive.service tdrive.service.backup
nano tdrive.service

Code below

tdrive rclone commands

Bash:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  Admin9705
# URL:        [URL]https://pgblitz.com[/URL] - [URL]http://github.pgblitz.com[/URL]
# GNU:        General Public License v3.0
################################################################################

[Unit]
Description=TDrive Daemon
After=multi-user.target

[Service]
Type=simple
User=0
Group=0
ExecStart=/usr/bin/rclone mount tdrive: /mnt/tdrive \
--config /opt/appdata/plexguide/rclone.conf \
--allow-non-empty \
--allow-other \
--size-only \
--uid=1000 --gid=1000 \
--umask 002 \
--log-file=/var/plexguide/logs/rclone-gdrive.log \
--log-level ERROR \
--timeout 1h \
--dir-cache-time 2m \
--vfs-cache-max-age 72h \
--vfs-read-chunk-size 128M \
--vfs-read-chunk-size-limit 10G \
--drive-chunk-size 128M \
--buffer-size 64M \
--drive-use-trash=false \
--fast-list

ExecStop=/bin/fusermount -uz /mnt/tdrive
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Here the gdrive.service commands

cd /etc/systemd/system
cp gdrive.service gdrive.service.backup
nano gdrive.service

Code below !

Bash:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  Admin9705
# URL:        https://pgblitz.com - http://github.pgblitz.com
# GNU:        General Public License v3.0
################################################################################

[Unit]
Description=GDrive Daemon
After=multi-user.target

[Service]
Type=simple
User=0
Group=0
ExecStart=/usr/bin/rclone mount gdrive: /mnt/gdrive \
--config /opt/appdata/plexguide/rclone.conf \
--allow-non-empty \
--allow-other \
--size-only \
--uid=1000 --gid=1000 \
--umask 002 \
--log-file=/var/plexguide/logs/rclone-gdrive.log \
--log-level ERROR \
--timeout 1h \
--dir-cache-time 2m \
--vfs-cache-max-age 72h \
--vfs-read-chunk-size 128M \
--vfs-read-chunk-size-limit 10G \
--drive-chunk-size 128M \
--buffer-size 64M \
--drive-use-trash=false \
--fast-list

ExecStop=/bin/fusermount -uz /mnt/gdrive
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

--fast-list = https://rclone.org/drive/#fast-list

Small FYI

In tests, these batch requests were up to 20x faster than the regular method. Running the following command against different sized folders gives:


small folder (220 directories, 700 files):

  • without --fast-list: 38s
  • with --fast-list: 10s
large folder (10600 directories, 39000 files):

  • without --fast-list: 22:05 min
  • with --fast-list: 58s
But !!!!! --FAST-LIST need more ram !!

For user with 8GB ram is this kill-code !!

Dont used it !! Its specify for user with 32GB and more ram !!

For reloading the commands //

AIO solution
You must edit the files before you start here !!

For uncrypted drives

systemctl daemon-reload && service tdrive restart && service gdrive restart
 
Last edited by a moderator:
M

MrDoob

Guest
Original poster
If you use encrypted drives

You must edit also

this files before you reload the daemon

tcrypt and gcrypt

systemctl daemon-reload && service tdrive restart && service gdrive restart && service tcrypt restart && service gcrypt restart
 

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,112
makes sense, great info!
 

hooper

Governer
Staff
Donor
Aug 1, 2018
310
119
Would be good if we could add --fast-list as an option we can select when deploying the rclone mounts
 
  • Love
Reactions: 1 user

Nigel

Experienced+
Staff
Donor
Jan 20, 2018
142
43
Good idea. Wouldnt add the —fast-list by default.
 
Last edited:
  • Love
Reactions: 1 user

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,112
ya can do guys
 
M

MrDoob

Guest
Original poster
Good idea. Wouldnt add the —fast-list by default.
Simply

We add --fast-list as default if ram size over 32GB ;)

So no user under 32GB ram run in any issues ;)
 
  • Like
Reactions: 1 user

justinglock40

Experienced
May 27, 2018
67
13
I tried adding the use trash=false line and it causes the tcrypt service to break??? systemctl says failed when restarting
 

Recommend NewsGroups

      Up To a 58% Discount!

Trending