INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: glynor on August 09, 2013, 06:40:07 pm

Title: New Option for MCC_BACKUP_LIBRARY
Post by: glynor on August 09, 2013, 06:40:07 pm
While lots of back-end stuff seems to be happening (by the way, I think I love the new Grouping stuff, and asked for as much a while back)... Can you add a ,1 option to MCC_BACKUP_LIBRARY that automatically (silently) saves a backup to the currently configured automatic backup location?

Pretty, pretty please, with a cherry on top?
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: InflatableMouse on August 10, 2013, 12:29:29 am
I'll add my cherry too.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 10, 2013, 04:26:37 am
Yes, please. I'm terrified of my library breaking down when it only takes a backup at restart of the application. My server can go for lots of weeks before it's restarted.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: jgreen on August 10, 2013, 04:33:14 pm
This new backup, will it append an incrementing number to the saved filename, or will it simply overwrite the previous?
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: InflatableMouse on August 11, 2013, 03:54:18 am
It's not really new. MC currently backs up its library automatically based on  ... something. I don't really know. Whatever its triggers are, Glynor's suggestion would simply trigger this mechanism and force MC to do its thing.

I've seen monthly backups named "MC Library Backup (Main Library - August).zip" and "MC Library Backup (Main Library - August) (1).zip" with a creation date 5 days later. So it is capable of numbering but I can't remember seeing daily backups with a (1) in the name.

Personally I think it would be ideal if it would number the daily backups too, or even allow calling MCC_BACKUP_LIBRARY with a target path and/or filename if that's possible?

Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 11, 2013, 10:51:42 am
A command for this would be great. But I believe that most people would find a simple "Backup each day" option sufficient. As long as it's triggered each day, and does not require MC to re restarted. I've always wondered why the old backup command gives you a prompt. Just removing that would probably give Glynor the tool he want?
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: Matt on August 11, 2013, 11:11:39 am
Just to be clear, the program already makes regular backups.

I believe Glynor knows this, and is asking for a little addition.  It seems like a reasonable request, so we'll see what we can do.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 11, 2013, 01:18:57 pm
It does? When was this changed? I can't find any backups since my holiday started in June.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: Matt on August 11, 2013, 02:22:47 pm
It does? When was this changed? I can't find any backups since my holiday started in June.

I believe SwellGuy (Rick) added it sometime around MC12 or 13.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 11, 2013, 02:25:13 pm
And how does it work? Where are the backups? I've noticed nothing like this. I've even asked for this a number of times since MC12 through at least MC16 I think.
Last I heard of backups it was still triggered only at startup. Even if it was supposed to be "automatic".
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: InflatableMouse on August 11, 2013, 03:31:20 pm
It makes regular backups, but not reliably.

I see days pass without backups and then it does several days in a row.

I'd be happy if I can run a task schedule around midnight that dumps the library to a designated folder of choice, and I can leave MC's own backups for what it is.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: glynor on August 11, 2013, 04:52:10 pm
Just to be clear, the program already makes regular backups.

I believe Glynor knows this, and is asking for a little addition.  It seems like a reasonable request, so we'll see what we can do.

Correct.

And, yes, following the exact same naming system as is used for the Automatic backups is fine.  I just want a way to trigger an "auto backup" manually, in order to force a backup before an operation does Library manipulation (for my addon).  But, I figured it would be nice for simple "making sure I have a weekly backup" purposes too (via Windows Task Scheduler) for those people who don't end up restarting MC very often.

I assume the reason it doesn't do it on a schedule in the background anyway (and does it at startup) is that the Backup operation is intensive and makes MC otherwise unresponsive.  Since you don't know when MC isn't regularly "in use" (you don't want to make video or audio playback stutter or whatever), then the "safest" time is during startup and shutdown.

I'm not sure why, if that is the reason, that it can't just detect inactivity (must be inactive for 2+ hours or something), but I'm guessing it has to do with the Library Clients and the fact that REST is stateless, so maybe you don't really know...?

In any case, we can, if we choose, make guesses about when it is "safe" to make MC "busy" for a bit in the background (at 3am, for example, might be fine for me, but bad for the guy using MC at the club that doesn't close till 4am).
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 12, 2013, 02:08:02 am
Why not just make the time for nightly backups user configurable? I would be fine any way. Detection of inactivity, static time, what ever. But I would sleep a bit better if there were some way I knew my backups were taken more regularly.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: jgreen on August 12, 2013, 07:08:25 am
Actually JGreen knows this also, and is simply agitating for an automagical numeration so that intra-daily backups (in this case manuall triggered) don't overwrite each other.  The current backup naming scheme is date-based only.  User configurability works for me also.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: glynor on August 12, 2013, 07:39:57 am
Why not just make the time for nightly backups user configurable? I would be fine any way. Detection of inactivity, static time, what ever. But I would sleep a bit better if there were some way I knew my backups were taken more regularly.

That wouldn't actually solve my problem, and this would solve both, without adding an additional option => Options Bloat.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 12, 2013, 07:59:18 am
I do understand that. It's just that commands and adding scheduled tasks to do this is not so user friendly. I would manage fine with it, so I'll just ask for the consideration of adding more reliable backups after Glynors wishes have been fulfilled :) I think more users who run servers with weeks and months of uptime would appreciate it.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: Matt on August 12, 2013, 09:37:48 am
Next build:
SDK: The MC command MCC_BACKUP_LIBRARY (20011) will perform a silent automatic backup when passed "1" as the parameter.
Changed: The program will run the automatic library code periodically instead of only at program start (so that running the program for long periods won't stop automatic backups from happening).
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: Matt on August 12, 2013, 09:39:15 am
A daily backup should be made every three days. 

A monthly is made once a month.

There's also provisions for cleaning up old backups, but I'm not sure the exact rules.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: InflatableMouse on August 12, 2013, 09:48:35 am
Thanks Matt. Appreciate it!  :D
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: jgreen on August 12, 2013, 11:54:21 am
An "expert mode" global option is a great way to cure option bloat.
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: MrHaugen on August 12, 2013, 02:06:46 pm
Great! Thanks Matt. I'll sleep a bit better now :)
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: glynor on August 12, 2013, 05:06:30 pm
Next build:
SDK: The MC command MCC_BACKUP_LIBRARY (20011) will perform a silent automatic backup when passed "1" as the parameter.
Changed: The program will run the automatic library code periodically instead of only at program start (so that running the program for long periods won't stop automatic backups from happening).

Who's awesome?  ^^^^  That guy!
Title: Re: New Option for MCC_BACKUP_LIBRARY
Post by: InflatableMouse on August 13, 2013, 09:03:43 am
Yup! Works great too and files get numbered if there's already one with the same name.