Add the ability to sync backup schedule with Plex DB backup #18
tim-shortons
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
This would be my preferred method, but I see a potential problem. If the script runs on the same day that Plex backs up it's database, but the script runs before Plex does it's backup then the script won't do a backup that day. So the script would never do a backup. The solution to this would be to ignore the actual date and just check if Plex has done a DB backup within the last 24 hours. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Plex runs DB backups every three days and you can't schedule this in cron without some additional logic.
I have a small script that does the following. Take the current date, subtract the original plex DB execution date, determine if it has been three days and if so run the back up script. This cron job runs every day, but it will only execute on a three day cadence when the modulo evaluation returns 0.
Perhaps this can be incorporated into the script? I can see a simple param driven approach where you set your first day of plex backup as a date variable in the config file and it uses that date to determine if it has been three days to run the backup. This is rather inflexible and if for some reason the plex DB backup gets out of schedule you would need to manually update the script or config file, depending on implementation.
Another option that would be more flexible would be to parse the plex DB filename for the date value and evaluate if that date is equal to the current date and if so run the backup script.
Beta Was this translation helpful? Give feedback.
All reactions