public static void MoveLogFiles( KeepBack.Ctrl ctrl ) { try { string src = ctrl.Path; string dst = ctrl.CreateLogFolder(); foreach( string x in KeepBack.Ctrl.ListFiles( src ) ) { if( (Path.GetExtension( x ).ToLower() == ".log") && KeepBack.Ctrl.IsDateFolder( x ) ) { File.Move( Path.Combine( src, x ), Path.Combine( dst, x ) ); } } } catch( Exception ) { } }
//--- method ---------------------------- public void Upgrade( KeepBack.CtrlFilter filter, KeepBack.CtrlFilter.ActionType action ) { filter.Action = action; filter.Pattern = Pattern; }
//--- method ---------------------------- public void Upgrade( KeepBack.CtrlArchive archive ) { archive.Month = Month; archive.Day = Day; archive.Hour = Hour; archive.Minute = Minute; foreach( CtrlFolder f in folders ) { f.Upgrade( archive.FolderAdd() ); } }
//--- method ---------------------------- public void Upgrade( KeepBack.CtrlFolder folder ) { folder.Name = Name; folder.Path = Path; if( exclude != null ) { foreach( CtrlPattern p in exclude ) { p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.Exclude ); } } if( include != null ) { foreach( CtrlPattern p in include ) { p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.Include ); } } if( history != null ) { foreach( CtrlPattern p in history ) { p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.History ); } } }