Exemple #1
0
        public static void Restore(string lz4File)
        {
            if (File.Exists(lz4File))
            {
                string tarPath = Path.Combine(Settings.Default.BackupPath, $"{DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss")}.tar");

                LZ4Util.Decompress(lz4File, tarPath);

                TarUtil.ExtractTar(tarPath, Settings.Default.ProfilePath);
            }
        }
Exemple #2
0
        public static string Backup()
        {
            //Create paths
            string tarPath = Path.Combine(Settings.Default.BackupPath, $"{DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss")}.tar");
            string lz4Path = Path.Combine(Settings.Default.BackupPath, $"{DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss")}.lz4");

            //First get a tar from the profile folder
            TarUtil.CreateTar(Settings.Default.ProfilePath, tarPath);
            LZ4Util.Compress(tarPath, lz4Path);

            return(lz4Path);
        }