Plex backup script


coblck

Recommended Posts

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
Link to comment

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
Link to comment

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.

Link to comment

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.

  • Thanks 1
Link to comment

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 

  • Thanks 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.