Beispiel #1
0
        internal IEnumerable <IFSEntry> GetFilesToBackup(/*string currentPath, int depth*/)
        {
            IEnumerable <Node.IFSEntry> enumerable = null;

            if (backupType == BackupLevel.Full || backupType == BackupLevel.Default)
            {
                enumerable = GetFull(true);
            }
            else if (backupType == BackupLevel.Refresh)
            {
                //try{
                enumerable = GetIncremental();
                //}
                //catch{ //Unable to find a suitable IncrementalPluginProvider BtrfsProvider, defaulting to full
                //	enumerable = GetFull(true);
                //}
            }

            /*else if(backupType == BackupLevel.SyntheticFull)
             *      enumerable = GetIncremental(true);*/

            foreach (IFSEntry entry in enumerable)
            {
                //Console.WriteLine (" * ** * *  * * * * ** * * entry 1 : "+entry.Name);
                //Console.WriteLine (" * ** * *  * * * * ** * * entry 2: match="+sp.Matches(entry.Name));
                if ((entry.Kind != FileType.Directory && entry.Kind != FileType.MountPoint &&
                     entry.Kind != FileType.Hardlink) &&
                    !includeSp.Matches(entry.Name))

                {
                    Console.WriteLine(" * **BRDH GetFilesToBackup *  * * entry DOES NOT MATCH include rule");
                    continue;
                }

                // check if entry hasn't to be excluded
                if (excludeSp.Matches(entry.Name))
                {
                    Console.WriteLine(" * **BRDH GetFilesToBackup *  * * entry DOES MATCH exclude rule");
                    continue;
                }
                if (entry.ChangeStatus != DataLayoutInfos.Deleted)
                {
                    entry.OriginalFullPath = entry.SnapFullPath.Replace(backupRootDrive.Snapshot.MountPoint, backupRootDrive.Snapshot.Path);
                }
                yield return(entry);

                nbItems++;
            }
            //Console.WriteLine (" * ** * *  * BRDH GetFilesToBackup DONE END MEHOD");
        }