/// <summary> /// Main method, pass folder name as argument. /// </summary> public static int Main(string[] args) { Utils.ConfigureLogging(); PathRepresentationConverter.SetConverter(new WindowsPathRepresentationConverter()); CmisSyncOnce once = new CmisSyncOnce(); // Load the specified synchronized folders, or all if none is specified. if (args.Length > 0) { for (int i = 0; i < args.Length; i++) { once.AddSynchronizedFolder(args[i]); } } else { Config config = ConfigManager.CurrentConfig; foreach (CmisSync.Lib.Config.SyncConfig.Folder folder in config.Folders) { RepoInfo repoInfo = folder.GetRepoInfo(); once.repos.Add(repoInfo); } } // Synchronize all bool success = once.Sync(); // Exit code 0 if synchronization was successful or not needed, // 1 if synchronization failed, or could not run. return(success ? 0 : 1); }
/// <summary> /// Main method, pass folder name as argument. /// </summary> public static void Main (string[] args) { Utils.ConfigureLogging(); CmisSyncOnce once = new CmisSyncOnce(); // Load the specified synchronized folders, or all if none is specified. if (args.Length > 0) { for (int i = 0; i < args.Length; i++) { once.AddSynchronizedFolder(args[i]); } } else { Config config = ConfigManager.CurrentConfig; foreach (CmisSync.Lib.Config.SyncConfig.Folder folder in config.Folders) { RepoInfo repoInfo = folder.GetRepoInfo(); once.repos.Add(repoInfo); } } // Synchronize all once.Sync(); }
/// <summary> /// Main method, pass folder name as argument. /// </summary> public static void Main(string[] args) { Utils.ConfigureLogging(); CmisSyncOnce once = new CmisSyncOnce(); // Load the specified synchronized folders, or all if none is specified. if (args.Length > 0) { for (int i = 0; i < args.Length; i++) { once.AddSynchronizedFolder(args[i]); } } else { Config config = ConfigManager.CurrentConfig; foreach (CmisSync.Lib.Config.SyncConfig.Folder folder in config.Folders) { RepoInfo repoInfo = folder.GetRepoInfo(); once.repos.Add(repoInfo); } } // Synchronize all once.Sync(); }
/// <summary> /// Main method, pass folder name as argument. /// </summary> public static int Main(string[] args) { System.Console.WriteLine("Started CmisSyncOnce"); Utils.ConfigureLogging(); Logger.Info("Starting. Version: " + CmisSync.Lib.Backend.Version); // Uncomment this line to disable SSL checking (for self-signed certificates) // ServicePointManager.CertificatePolicy = new YesCertPolicyHandler(); PathRepresentationConverter.SetConverter(new WindowsPathRepresentationConverter()); CmisSyncOnce once = new CmisSyncOnce(); // Load the specified synchronized folders, or all if none is specified. if (args.Length > 0) { for (int i = 0; i < args.Length; i++) { once.AddSynchronizedFolder(args[i]); } } else { Config config = ConfigManager.CurrentConfig; foreach (CmisSync.Lib.Config.SyncConfig.Folder folder in config.Folders) { RepoInfo repoInfo = folder.GetRepoInfo(); once.repos.Add(repoInfo); } } // Synchronize all bool success = once.Sync(); //System.Console.WriteLine("Press enter to close..."); //System.Console.ReadLine(); // Exit code 0 if synchronization was successful or not needed, // 1 if synchronization failed, or could not run. return(success ? 0 : 1); }