What's new
PGBlitz.com

Register Now! Find useful tips, Interact /w Community Members and join the part the Best Community on the Internet!

Guides HOWTO: Cleanup leftover files in /mnt/download/nzbget directory

plex_noob

Senior Member
Staff
Donor
Hi,

I have an annoying problem that I couldn't solve up to now: Nzbget, Radarr/Sonarr or PGMove leaves files in the sub-directories within /mnt/download/nzbget. These files are temp mkv files but also copies of the uploaded movies et tv shows.
In order to avoid to clean manually these leftover files, I have created a workaround in order to prevent my storage to be filled up with these files.

The workaround uses the post scripts feature from nzbget.
The principle is quite simple: a schedule fires up a script that cleans up the mess left in the above mentioned sub folders.
I am using a script called tidyit which purpose is different to the one I am using it but it gives me the results expected.
The initial purpose of the script was: "searching your media libraries and performs house keeping on it by eliminating any meta files that have become wasted disk space since they are no longer referenced".
I use it to remove "all" the files left after PGMove has done his work.

Steps:
  1. Create a additional folder in /opt/appdata/nzbget/myscripts
  2. Copy the script in the newly created folder
  3. In nzbget, make sure to restart the service to detect the new script: Settings -> System -> Reload
  4. After the reload, a new entry in the settings should appear at the end of the list "TIDYIT"
  5. Selecting the new entry will display a new configuration page for the script. Here are the changes I made:
    1. Mode: Preview -> (Does not actually deletes the files)
    2. MovePath: [Empty] -> (Not used in our case)
    3. AlwaysTrash: *.* -> (We want to remove all the files left after the mode to Google drive)
    4. MetaContent: [Empty] -> (Not used in our case)
    5. VideoPaths: /mnt/downloads/nzbget/movies, /mnt/downloads/nzbget/tv -> (Specify all the sub directories that needs to be checked)
    6. VideoExtras: [Empty] -> (Not used in our case)
    7. VideoMin Size: 200000 -> (We specify intentionally a size that should never be reached in order to force the script to consider all the files left)
    8. ProcessMin Age: 15000 -> (We specify a value high enough in order to be sure the files that should be moved to Google drive have left the folder)
    9. VideoExtensions: *.vvvv -> (We specify intentionally a file extension that does not exists in order to force the script to consider all the files left)
    10. KeepDirectories: No -> (We asks the script to delete also the sub folders left)
    11. Debug: Yes -> (We want to be sure the script does what it is supposed to do and nothing else. Once the testing is ok, we change point 1. to "Delete" and this point to "No")
  6. Once the configuration has been done and validated buy testing the script (-> DoTidyButton). We need to add a schedule to NZBGet to run the script.
    1. "Settings"
    2. "Scheduler"
    3. "Add Another Task"
    4. Time: define when you want the script to be executed. Separate the times with a comma (e.g. 08:00, 16:00, 00:00)
    5. Weekdays: define which days the script should run
    6. Command: Select "Script"
    7. Param: Choose the script TidyIt
  7. Click "Save all Changes
This should be all.
 

kkalfun

Full Member
I restart nzbget but I dont see the script
Settings > Paths > Under "ScriptDir", put in the entire directory structure leading up to your scripts folder. Using plex_noob's example, /opt/appdata/nzbget/myscripts would be in that field instead of what they have by default. Don't forget to save.
 

ZeroFux

Junior Member
Settings > Paths > Under "ScriptDir", put in the entire directory structure leading up to your scripts folder. Using plex_noob's example, /opt/appdata/nzbget/myscripts would be in that field instead of what they have by default. Don't forget to save.
I tried this and I still don't see TIDYIT in the left pane after Reload. Am I looking in the right place?
 
Assists Greatly with Development Costs

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.


Top NZB NewsGroups!

Members - Up To a 58% Discount!

Development Donations

 

Online statistics

Members online
12
Guests online
172
Total visitors
184
Top