示例#1
0
        public void Compress(string inputPath, string outputFilename)
        {
            var filename = Path.Combine(Environment.CurrentDirectory, "Lib", "7z.exe");
            var command = string.Format("a \"{0}\" \"{1}\\*\"", outputFilename, inputPath);

            var pr = new ProcessRunner();
            pr.Run(filename, command);
        }
示例#2
0
        public void Transfer(string password, string localPath, string remotePath)
        {
            var filename = Path.Combine(Environment.CurrentDirectory, "Lib", "pscp.exe");
            var command = string.Format("-pw {0} \"{1}\" {2}", password, localPath, remotePath);

            var pr = new ProcessRunner();
            pr.Run(filename, command);
        }
示例#3
0
        public void ExportDatabase(string database, string outputFolder, TimeSpan timeAgo)
        {
            var filename = Path.Combine(Environment.CurrentDirectory, "Lib", "mongoexport.exe");

            foreach (var arg in BuildMongodumpArguments(timeAgo)) {
                var outputFile = Path.Combine(outputFolder, arg.Item1 + ".json");
                var command = string.Format("-db {0} -c {1} -o \"{2}\"", database, arg.Item1, outputFile);
                if (!string.IsNullOrWhiteSpace(arg.Item2))
                    command += string.Format(" -q {0}", arg.Item2);

                var pr = new ProcessRunner();
                pr.Run(filename, command);
            }
        }