======Phases of the synchronization process====== This is a simplified look behind the script to show you the phases of the synchronization process. Some optional steps are missing. **Phase 1: Read command line ** Sure we need some information what to do and where to get detailed instructions. For this the command line is read. **Phase 2: Read configuration file** Detailed instructions for the synchronization to the selected target is located in the [[IDfile|configuration file]]. This stuff is loaded into memory and some basic plausibility checks are made. **Phase 3: Prepare media for analysis** Script will make use or file attibute A (**A**rchive) to flag existing files on the target as 'good' in step 5. Therefore file attributes in all corresponding folders on the target need to be uniform. **Phase 4: Analyse Medialibrary** If instructed by command line, the Medialibrary is filtered for the selected audio files. Each matching item is matched against the defined rule-sets (loaded in step 2) to calculate the destination file-path, format and estimated size on the target. If the resulting file is NOT found on the target a 'flag-file' is created (see below). If the file found, the format and/or size is validated as defined by ConvertFormats (and flagged as 'good' if it's ok). As a result of phase 4, the script will have marked all 'good' Medialibrary files on the target and will have lists of the items that need to get copied / converted. **Phase 5: Analyse Playlists** Same as last phase, but now for your playlists. Which playlists to exclude/include are known from step 2. All corresponding playlists are processed and their items are checked against the rules. At this phase the new playlist-files (m3u) are created too (because we know, where the playlist items will be saeved after sync). In a future version I will implement a cross-check against the files from step 4 to save some extra space on target: If a playlist item is also part of step 4, M3U-index will then simply point to it. **Phase 5: Show statistics** After the analysis has finished, the amount of items to copy and/or convert is known. Also we know about the needed space on target and ophaned stuff. The folder structure and the files on the target will match the final result, except ophaned files and folders are still left. The script will pause. You can use the analysis console to get details about the results and you may want to have a look at the file-/folder-structure on target. If you did use option 't' in parameter tasks, the script will remove flag-files __and end then__ (because it was a test). **Phase 6: Erase orphant stuff** If you did NOT use option 'T' in tasks, all files that do not belong to your sync and/or are outdated (wrong bitrate/codec) are deleted. **Phase 7: Copy files** Now all missing files where NO convertion is needed are copied to their calculated destination paths. **Phase 8: Convert files** Files that are missing and need convertion are now converted. That's it! ---- - Check out the other Pages, that belong to the wiki-category [[Documentation]] ! - Ask and discuss at the [[http://www.hydrogenaud.io/forums/index.php?showtopic=108834|FoobarSync discussion thread on Hydrogenaudio Forums]]