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 filesSpecifies 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 keepEach 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).