IPB

Welcome Guest ( Log In | Register )

7 Pages V   1 2 3 > »   
Reply to this topicStart new topic
Autosave & Autobackup (foo_jesus), Free salvation for your configuration, playlists and soul.
Yirkha
post Jan 8 2009, 22:51
Post #1





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



This component allows periodic automatic saving of configuration and other data in foobar2000 and keeping backup copies of the profile folder.

The save operation itself does the same as (hidden) command "File > Save Configuration", that means it saves configuration (the whole configuration subfolder), Media library database (database.*), playlists and any additional data managed by other components (for example current theme or playback statistics).

Backup process stores configurable list of files and directories into a ZIP archive with file name like "autobackup.20091005-121722.zip" in user-specified folder. A ZIP archive is used to have everything in one file, as well as compress the (often large) database files a bit, using the fastest, but still significant and useful compression method. Very small files, as well as not much compressible files like archives and compressed images are not (re)compressed.

Configuration is possible through the following settings, available in "Autosave & Autobackup" branch in Advanced preferences:
  • Autosave while playing, every X minutes (0 = off)
    Time is counted when playback is active (i.e. not stopped nor paused) and when it exceeds this value, configuration is saved.
    Default value: 1 hour
  • Autosave when playback stops, after X minutes (0 = off)
    When playback was active, then stopped or paused for this amount of time, configuration is saved.
    Default value: 5 minutes
  • Always, no more than X minutes since last autosave (0 = off)
    Regardless of activity, when the last time autosave was run is more than so many minutes ago, configuration is saved.
    Default value: 1 day
  • On startup, after X minutes (backup only, 0 = off)
    After specified number of minutes after startup, a new backup archive with the current configuration is created.
    Note this trigger does not execute (the more intrusive) save configuration command, assuming nothing has changed since startup yet and because its point is to store the base configuration the application has been started with.
    Default value: 1 minute
  • Every X tracks (0 = off)
    Each time a track ends (it has played all the way through or another has been started manually, except when shutting down), a counter is incremented. When it exceeds this value, configuration is saved.
    Note that saving this way more often than 30 seconds since last autosave is blocked to avoid lock up or crash problems when going through a playlist too fast (e.g. on very short files or invalid entries).
    Default value: 0
  • Files and directories to back up (sep. by ;, relative to profile folder, wildcards supported)
    Items to store to the backup archive. Those which are not found are silently ignored. If an item is found out to be a directory, all files in it are added recursively.
    Default value: configuration;playlists;index-data;theme.fth;PlaybackStatistics.dat
  • Directory where to store the backup .zip files
    Specifies directory for the automatically created backups of the files and folders set above. If it doesn't exists, the component will attempt to create it. Can be either a relative path (in the fb2k's profile directory) or absolute, e.g. for storing the backups on external/remote disk.
    Default value: autobackup
  • Number of backup copies to keep
    Each time a new backup archive is created, older files matching "autobackup.*.zip" in the profile directory are deleted, to leave just last this number of them.
    Default: 2
All counters are reset whenever autosave is activated due to any of the criteria. For example, when using both "while playing (minutes)" and "after X tracks", whichever applies first will trigger the save.
A message like "Autosaving... (A)" is logged to console each time, among others to avoid "bug reports" regarding random lags. One of the letters PITA at the end reveals the reason – while Playing, when Idle, after Track or Always.

Note that configuration saving can be a resource intensive operation, particularly with larger libraries or playlists. It should not disturb playback, however user interface lag might occur.
The subsequent backup operation is run in a detached thread with lowered priority.

I've made the default settings rather conservative and according to my typical usage – each hour when foobar2000 is happily playing minimized, five minutes after everything has stopped and I'm going to do something else, then at least once a day just as a safety measure (if I haven't actually played anything and only experimented with some configuration changes, for example).

Your comments and suggestions are welcome.

 
Latest version:
  Autosave & Autobackup v10 [2010/09/23]
Dowload links:
  foo_jesus-v10.zip (43 KB)
  foo_jesus.dll (89 KB)
  mirror
Changelog:
  v10 [2010/09/23]
    - New: Use zlib1.dll bundled with core - the component needs foobar2000 v1.1 or newer now.
    - New: Don't compress .rar and .7z files (added to existing .zip, .jpg, .jpeg and .png).
    - New: Updated default backup item list: removed "foobar2000.cfg", added "index-data" (used e.g. by Playback Statistics v3.0+).
              Note: If you are upgrading from a previous version and changed the default pattern, you ought to do this manually.
    - Fixed: Filter . and .. pseudo-directories when backing up the whole profile folder (using * as the mask).
  v9 [2010/04/20]
    - New: Option for setting delay of the first backup after startup.
    - Fixed: Even lower priority for the backup thread.
  v8 [2010/01/03]
    - Fixed: Relative paths to destination directory.
  v7 [2010/01/02]
    - New: Backup ZIP files use compression.
    - New: Configurable backup destination directory.
    - Fixed: Added 30 second limit for per-track autosave to avoid main thread overload.
  v6 [2009/11/20]
    - Added a few things to ease debugging of obscure problems in other components.
  v5 [2009/10/05]
    - Fixed: Crash with empty backup filename pattern list.
  v4 [2009/10/04]
    - New: Added backup features.
  v0.0.3 [2009/03/21]
    - Fixed: Crash when autosaving after number of tracks with Preferences dialog open.
  v0.0.2 [2009/01/09]
    – New: Ability to save each time a configured number of tracks has been played.
  v0.0.1 [2009/01/08]
    – Initial release.


This post has been edited by Yirkha: Sep 23 2010, 01:38


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
bulhakov
post Jan 8 2009, 23:16
Post #2





Group: Members
Posts: 43
Joined: 18-July 07
Member No.: 45428



Wow, I've been waiting for ages for such component. Could be very useful for people who like playing with ColumnsUI or PanelsUI. Thanks
Go to the top of the page
+Quote Post
foorious
post Jan 9 2009, 01:37
Post #3


troll / ban evasion


Group: Banned
Posts: 244
Joined: 22-April 08
Member No.: 52991



Thanks Yirkha for this useful component (foo_jesus... biggrin.gif ). This could even have been a part of foobar2000 !

Now for the "just a little improvement" thing tongue.gif : saving your config, playlists & co. is nice, but it has happened to me more than once in the past to end up with a corrupt foobar2000.cfg file (because of other software running and making fb2k crash, not enough free memory which would mess up with foobar quitting, whatever). In that case, you'd better have a recent backup of that precious cfg file if you don't want to start all over again. So, would it be a good idea to automatically backup the foobar2000.cfg in the same folder ? (maybe some foobar2000.cfg.bak, I don't know, you get the point).

Thanks again.
Go to the top of the page
+Quote Post
freetochoose
post Jan 9 2009, 03:48
Post #4





Group: Members
Posts: 99
Joined: 25-August 08
Member No.: 57492



Thanks for the great component. I am just wondering if you can add a menu item or I can create a command button to save all configurations on demand. Sometimes I know that I have made a few changes to configurations and playlists, if I don't save them I might lose them all should there be a crash.

ftc
Go to the top of the page
+Quote Post
ZeeJay
post Jan 9 2009, 06:10
Post #5





Group: Members
Posts: 50
Joined: 22-February 08
Member No.: 51505



Great improvement to foobar2000.
Really thanks for this component!

BTW, there is a better name for it?

Edit: typo.

This post has been edited by ZeeJay: Jan 9 2009, 08:26
Go to the top of the page
+Quote Post
Axon
post Jan 9 2009, 06:45
Post #6





Group: Members (Donating)
Posts: 1985
Joined: 4-January 04
From: Austin, TX
Member No.: 10933



Who else saves better than Jesus?

This post has been edited by Axon: Jan 9 2009, 06:45
Go to the top of the page
+Quote Post
2E7AH
post Jan 9 2009, 07:32
Post #7





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



first save yourself (File > Save Configuration), then ask Jesus
Go to the top of the page
+Quote Post
ZeeJay
post Jan 9 2009, 08:20
Post #8





Group: Members
Posts: 50
Joined: 22-February 08
Member No.: 51505



QUOTE (Axon @ Jan 9 2009, 02:45) *
Who else saves better than Jesus?


The Invisible Pink Unicorn.
Go to the top of the page
+Quote Post
DocBeard
post Jan 9 2009, 12:30
Post #9





Group: Members
Posts: 337
Joined: 28-October 06
Member No.: 36898



QUOTE (freetochoose @ Jan 8 2009, 20:48) *
I am just wondering if you can add a menu item or I can create a command button to save all configurations on demand.


This ability actually exists already. It's not visible on the menu, but you can bind File->Save Configuration to a keyboard shortcut or to a button (the latter I've only tested in Columns UI because I am deeply lazy, but there's no reason it shouldn't work in Default as well).

Anyhow, thanks for the component, Yirkha!
Go to the top of the page
+Quote Post
freetochoose
post Jan 9 2009, 18:10
Post #10





Group: Members
Posts: 99
Joined: 25-August 08
Member No.: 57492



QUOTE (DocBeard @ Jan 9 2009, 05:30) *
QUOTE (freetochoose @ Jan 8 2009, 20:48) *

I am just wondering if you can add a menu item or I can create a command button to save all configurations on demand.


This ability actually exists already. It's not visible on the menu, but you can bind File->Save Configuration to a keyboard shortcut or to a button (the latter I've only tested in Columns UI because I am deeply lazy, but there's no reason it shouldn't work in Default as well).

Anyhow, thanks for the component, Yirkha!


Thanks, DocBeard. It was not obvious to me before, now I know.
Go to the top of the page
+Quote Post
Yirkha
post Jan 9 2009, 18:40
Post #11





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



QUOTE (foorious @ Jan 9 2009, 01:37) *
Saving your config, playlists & co. is nice, but it has happened to me more than once in the past to end up with a corrupt foobar2000.cfg file (because of other software running and making fb2k crash, not enough free memory which would mess up with foobar quitting, whatever). In that case, you'd better have a recent backup of that precious cfg file if you don't want to start all over again. So, would it be a good idea to automatically backup the foobar2000.cfg in the same folder ?
It's the core what does the saving, this component only launches the menu command to do it, so there is no reliable control over that part.

Maybe start using Windows Vista… cool.gif

ETA: mikusr reminded me that "Previous versions" is available only in Business, Enterprise and Ultimate SKU's.

This post has been edited by Yirkha: Jan 9 2009, 19:25


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
LordWarlock
post Jan 9 2009, 19:03
Post #12





Group: Members
Posts: 120
Joined: 21-August 05
Member No.: 24044



Would it be possible to add an option to save every time playback of a new track starts?
Go to the top of the page
+Quote Post
Yirkha
post Jan 9 2009, 19:29
Post #13





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



I thought about that initially, then everything became time-based, so I abandoned it. I also don't like constant updates, because when something bad happens while saving, it creates much bigger problems. I guess I made it usable with rather long intervals also because I don't care about recent activity much. I was only surprised sometimes when my changes from last month were gone or so.

But oh well, you are second to ask for this, I will give it another thought.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
Harun
post Jan 9 2009, 19:46
Post #14





Group: Members
Posts: 55
Joined: 13-March 07
Member No.: 41449



praise the lord! biggrin.gif

Thanks for a plugin that is useful. I can't tell you how many times I've had to redo things to my theme/layout, remake playlists, etc because they went into oblivion. This plugin is probably essential enough to most users that it should be a built-in feaure of foobar2000.
Go to the top of the page
+Quote Post
Yirkha
post Jan 9 2009, 21:05
Post #15





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



v0.0.2 released, first post in this topic updated.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
Hakubo
post Jan 10 2009, 01:02
Post #16





Group: Members
Posts: 260
Joined: 20-April 06
Member No.: 29815



Thank you Yirkha, this component kind of made my day.
Go to the top of the page
+Quote Post
d0ng
post Jan 10 2009, 03:51
Post #17





Group: Members
Posts: 55
Joined: 18-December 06
Member No.: 38804



What a cool name for a plugin. WWJD?

Its a great plugin, saves me the hassle of redoing all those keyboard configs. smile.gif Thanks Yirkha
Go to the top of the page
+Quote Post
skelly831
post Jan 10 2009, 06:38
Post #18





Group: Members (Donating)
Posts: 782
Joined: 11-April 05
From: México
Member No.: 21361



Cool component, this should save me some work after my neighborhood's frequent pawer outages lol


--------------------
we was young an' full of beans
Go to the top of the page
+Quote Post
Borisz
post Jan 11 2009, 02:36
Post #19





Group: Members
Posts: 381
Joined: 27-September 03
Member No.: 9041



QUOTE (foorious @ Jan 9 2009, 01:37) *
Thanks Yirkha for this useful component (foo_jesus... biggrin.gif ). This could even have been a part of foobar2000 !

Now for the "just a little improvement" thing tongue.gif : saving your config, playlists & co. is nice, but it has happened to me more than once in the past to end up with a corrupt foobar2000.cfg file (because of other software running and making fb2k crash, not enough free memory which would mess up with foobar quitting, whatever). In that case, you'd better have a recent backup of that precious cfg file if you don't want to start all over again. So, would it be a good idea to automatically backup the foobar2000.cfg in the same folder ? (maybe some foobar2000.cfg.bak, I don't know, you get the point).

Thanks again.

Going further, it would be useful if the plugin could make whole config backups at set intervals, timestamped into an alternate directory (like backup\20081119\). The shadow copy functionality in Vista is very useful but not available for all.

Also, best plugin description ever.


--------------------
http://evilboris.sonic-cult.net/346/
Sega Saturn, Shiro!
Go to the top of the page
+Quote Post
foorious
post Jan 11 2009, 13:17
Post #20


troll / ban evasion


Group: Banned
Posts: 244
Joined: 22-April 08
Member No.: 52991



Yes, some of us don't want to use Vista because XP is lighter and better for a HTPC.
Moderation: This point has been disputed, see the split topic here.

Any backup software could automatically make those foobar.cfg backups, but it would be even better if a foobar component (or foobar itstelf... hint, hint wink.gif ) could do it.

This post has been edited by Yirkha: Jan 18 2009, 03:07
Go to the top of the page
+Quote Post
Leak
post Mar 3 2009, 17:36
Post #21





Group: Members
Posts: 92
Joined: 15-October 04
From: Linz, Austria
Member No.: 17657



QUOTE (Yirkha @ Jan 9 2009, 19:40) *
It's the core what does the saving, this component only launches the menu command to do it, so there is no reliable control over that part.

Ummm... unless there's no way to know where the config file itself resides couldn't the component just do a regular ol' file copy to a (configurable) backup directory *before* making Foobar2000 save it's configuration? That should pretty much have the desired effect...


--------------------
np: 4'33"
Go to the top of the page
+Quote Post
Yirkha
post Mar 3 2009, 18:17
Post #22





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



Thank you, such ideas are welcome.

It is possible to retrieve the path of profile directory.

Now what files should be copied? You can't know if some component writes extra configuration files (e.g. PlaybackStatistics.dat).

Copying everything is not a good solution - for example, portable installations use the installation directory as profile directory, so all components and any other random junk someone stores there would be copied as well each time.

Configurable list of files to back up? No thanks.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
mrinferno
post Mar 6 2009, 14:55
Post #23





Group: Members
Posts: 135
Joined: 19-June 07
Member No.: 44533



thanks for the work on the plug-in, trying it out today. it's pretty much exactly what i've been hoping for and i'm glad i just happened to stumble on it today.

I agree, there is no need to automatically copy the files from the %appdata%\foobar2000 and %programfiles%\foobar2000 folders, you can easily do that already do that using backup scripts (robocopy or winrar, etc). besides it doesn't really need to be done that often.

the most useful thing for me is the autosaving of playlists and playback stats database.

will be very useful on my work laptop, where I have to test software and occasionally BSOD after hours of having foobar open playing tracks. I use foo_removeplayed, so this will awesome as i won't have to manually edit any playlists i was listening to after a crash.

also, i didn't know about the hidden menu file -> save configuration ;-) learn something new about foobar every day i guess.
Go to the top of the page
+Quote Post
Yirkha
post Mar 21 2009, 12:30
Post #24





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



v.0.0.3 released, addresses issue with autosaving after number of tracks with Preferences dialog open.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
fbuser
post Mar 21 2009, 18:54
Post #25





Group: Developer
Posts: 688
Joined: 26-September 07
Member No.: 47369



Doesn't work with foobar2000 0.9.5.6 anymore.
On startup you get the message: Module "foo_jesus.dll" has been removed since last run. Would you like to keep its settings?
After answering the question for keeping the settings with yes or now you get:
Failed to load DLL: foo_jesus.dll
Reason: Die angegebene Prozedur wurde nicht gefunden.
(Translation: The specified procedure could not be found)

This post has been edited by fbuser: Mar 21 2009, 18:55
Go to the top of the page
+Quote Post

7 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th December 2014 - 03:52