Esempio n. 1
0
        public override int run(BUCommon.AccountList accounts)
        {
            var account = _getAcct(accounts, _opts.account);
            var cont    = accounts.filecache.containers
                          .Where(x => x.accountID == account.id && x.name == _opts.container)
                          .ToList();

            var cmd = new BackupLib.commands.Sync
            {
                account     = account
                , cache     = accounts.filecache
                , container = cont.FirstOrDefault()
                , progress  = _printDiff
                , excepts   = _printExcept

                , noAction   = _opts.dryrun
                , keyFile    = _opts.keyfile
                , pathRoot   = _opts.pathroot
                , useRemote  = _opts.useremote
                , privateKey = _opts.privateKey
                , filterRE   = _opts.filterre
                , excludeRE  = _opts.excludere
                , maxTasks   = _opts.maxTasks
                , checksum   = _opts.cksum
            };

            Console.WriteLine("Account: {0}", account.name);
            Console.WriteLine("Container: {0}", cmd.container.name);

            cmd.run();

            return(0);
        }
Esempio n. 2
0
        public void CmdSync()
        {
            var acct = _getAcct();

            var cont = acct.service.fileCache.getContainers(acct.id).FirstOrDefault();

            var cr = new BackupLib.commands.Sync
            {
                account     = acct
                , cache     = acct.service.fileCache
                , container = cont
                , keyFile   = pubKey
                , pathRoot  = testRoot
            };

            cr.run();
        }
Esempio n. 3
0
        public void Sync()
        {
            var accts = _makeSvc();
            var acct  = accts.accounts[0];

            var conts = new BackupLib.commands.Containers {
                account = acct, cache = accts.filecache
            };

            conts.run();

            var cont = accts.filecache.containers[0];

            var cr = new BackupLib.commands.Sync
            {
                account   = acct, cache = accts.filecache, container = cont
                , keyFile = @"C:\tmp\id_rsa_1_pub", pathRoot = @"C:\tmp\photos"
            };

            cr.run();

            accts.filecache.save(@"c:\tmp\b2test\cache_sync.xml");
        }