Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Plex backup script

Featured Replies

@Cpt. Chaz Hi following our discussion on youe excellent script for plex back up wonder if you can have a quick look at my script see if anything pops out 

plec backup script.txt

Hi again @coblck , happy to help. it looks like your script has quotes around the mtime entry that shouldn't be there. here is how it should look instead:

 

#ENTER NUMERIC VALUE OF DAYS AFTER "-MTIME +"
find $pdest* -mtime +1 -exec rm -rfd {} \;

 

try that and see how it does. If it still doesn't remove the old backups, post a copy of the logs and lets take a look at that. on the user script page, look towards the right and you should see an icon on the line of your script that you can click to view the log for that script

 

374419642_ScreenShot2021-02-24at2_08_45PM.png.e32811333cc9c4241e25cfce13bfd6a2.png

 

Keep me posted

Edited by Cpt. Chaz
typo

Actually, I think your problem may be an error in the syntax from the script. I checked my logs and it was reporting a similar error.  in addition to removing the quotes you added to mtime, try taking out the asterisk so it looks like this

 

#ENTER NUMERIC VALUE OF DAYS AFTER "-MTIME +"
find $pdest -mtime +1 -exec rm -rfd {} \;

 

This seemed to fix it for me. If that also fixes it for you, i'll publish a correction. thanks for your input on this! 

Edited by Cpt. Chaz

  • Author

Good morning mate here is a copy of log and script still seeing undleted files in backup folder 

Log.txt Script.txt

ok, starting to suspect something else may be going on with your system. copy and pasting your script line into my terminal (just adjusting paths) on two different servers of mine works the way it should. try typing this into a terminal window:

 

find /mnt/user/Backup/Plex/ -mtime +1 -exec rm -rfdv {} \;

 

If there's no visible errors in the terminal, check the plex backup folder and see if older files were removed, then report back with your findings. however, you may get an output in the terminal, showing a similar error to what's in your logs like find: unknown predicate `-mtime +1' (this is what i'm expecting). The source of this problem may also help explain why your gui notification is not working at the end too, as your script line for this works for me but it's obviously not working for you. 

 

Then:

 

If you do get an error, let's try the following - install the nerd pack plugin from Community Applications if you don't already have it. Once this is installed, open it up and make sure you have the following items "turned on":

  • ncurses-terminfo-6.1.20191130-x86_64-1.txz
  • perl-5.32.0-x86_64-1.txz

 

Once that's turned on, reboot the server and try running the command above and see if anything changes. If you still get an error after enabling this, post back here the terminal output of the error. At that point we'll need to call in some bigger guns to help us figure out whats going on with your server.

  • Author

 

Hi mate thanks for your reply very much appreciated, typed in terminal with +1 and nothing deleted but no errors, i changed to +0 and deleted folder see below 

 

 

 

 

image.png.91e7043a6a0a87123f9b3aa60f189b2e.png

  • Author

ive now lost the option buttons for the logs in user scripts page 

Screenshot 2021-02-25 172739.jpg

Edited by coblck

the user scripts logs don't persist after a reboot, so that's ok.

 

i was about to suggest taking this over to the user script forum, but it look's like you're already there. i think a better post there would be to ask about why the bottom lines in the script aren't working on your server. they're basic linux commands, and the syntax works perfectly for me on my servers so after our troubleshooting i'm stumped as to why they're not working for you. when you make your post there, you can link to this topic for context to users that may be able to help. you may also want to post your script and logs there directly, too. i'll be following and keeping up with what's going on.

  • Author

Ok will do thanks very much will the log buttons reappear ??

they sure will! once your scripts run again, there will be a log entry.

  • Author

OK many thanks will ask for some help over in the other forum. Main thing is that it's backed up. I'm going to be moving my plex folder to a new nvme drive tomorrow on unassigned devices so hopefully go ok. Thanks again and please keep up good work on you tube considering becoming a patreon 

cool deal, hope all goes well. i'll keep an eye on the user script forum, and see what others have to say as well. feel free to reach back out with anything else. cheers!

Edited by Cpt. Chaz

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.