Utility that performs a single synchronization. Useful for scripts, cron or command-line usage.
示例#1
0
        /// <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();
		}
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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();
        }
示例#4
0
        /// <summary>
        /// Main method, pass folder name as argument.
        /// </summary>
		public static void Main (string[] args)
		{
            // Check arguments.
            if (args.Length < 1)
            {
                System.Console.WriteLine("Usage: CmisSyncOnce.exe mysyncedfolder");
                System.Console.WriteLine("Example: CmisSyncOnce.exe \"192.168.0.22\\Main Repository\"");
                System.Console.WriteLine("See your folders names in C:\\Users\\you\\AppData\\Roaming\\cmissync\\config.xml or similar");
                return;
            }

            // Load and synchronize.
			CmisSyncOnce once = new CmisSyncOnce();
			once.Init(args[0]);
            once.Sync();
		}
示例#5
0
        /// <summary>
        /// Main method, pass folder name as argument.
        /// </summary>
        public static void Main(string[] args)
        {
            // Check arguments.
            if (args.Length < 1)
            {
                System.Console.WriteLine("Usage: Oris4SyncOnce.exe mysyncedfolder");
                System.Console.WriteLine("Example: Oris4SyncOnce.exe \"192.168.0.22\\Main Repository\"");
                System.Console.WriteLine("See your folders names in C:\\Users\\you\\AppData\\Roaming\\oris4sync\\config.xml or similar");
                return;
            }

            // Load and synchronize.
            CmisSyncOnce once = new CmisSyncOnce();

            once.Init(args[0]);
            once.Sync();
        }
示例#6
0
        /// <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);
        }