diff --git a/BuildTime.txt b/BuildTime.txt index 9e7cfef..5f16e49 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-02-12 10:39:20 \ No newline at end of file +2026-02-12 23:50:58 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index 820c117..a4f6968 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -f19cad7 \ No newline at end of file +6107ecc \ No newline at end of file diff --git a/docs/cmleonos/docs/commands.md b/docs/cmleonos/docs/commands.md index c4aa55c..aff57f6 100644 --- a/docs/cmleonos/docs/commands.md +++ b/docs/cmleonos/docs/commands.md @@ -767,34 +767,6 @@ restart shutdown ``` -## 备份与恢复命令 - -### backup -备份系统。 - -**用法:** -```bash -backup -``` - -**示例:** -```bash -backup mybackup.zip -``` - -### restore -恢复系统备份。 - -**用法:** -```bash -restore -``` - -**示例:** -```bash -restore mybackup.zip -``` - ## 测试命令 ### cuitest diff --git a/shell/CommandList.cs b/shell/CommandList.cs index eff36d9..3e6878d 100644 --- a/shell/CommandList.cs +++ b/shell/CommandList.cs @@ -166,12 +166,6 @@ namespace CMLeonOS.shell case "grep": shell.GrepFile(args); break; - case "backup": - shell.BackupSystem(args); - break; - case "restore": - shell.RestoreSystem(args); - break; case "ftp": shell.CreateFTP(); break; diff --git a/shell/Commands/Help/Help.cs b/shell/Commands/Help/Help.cs index 938ca71..0454515 100644 --- a/shell/Commands/Help/Help.cs +++ b/shell/Commands/Help/Help.cs @@ -278,18 +278,6 @@ namespace CMLeonOS.Commands Description = "Execute Branswe code file" }, new CommandInfo - { - Command = "backup", - Parameters = "", - Description = "Backup system files" - }, - new CommandInfo - { - Command = "restore", - Parameters = "", - Description = "Restore system files" - }, - new CommandInfo { Command = "grep", Parameters = " ", diff --git a/shell/Shell.cs b/shell/Shell.cs index b49e78f..f017b73 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -408,7 +408,7 @@ namespace CMLeonOS "mv", "rename", "touch", "find", "tree", "grep", "getdisk", "user", "cpass", "hostname", "ipconfig", "setdns", "setgateway", "nslookup", "ping", "wget", "ftp", "tcpserver", "tcpclient", "lua", "branswe", - "beep", "backup", "restore", "env", "whoami", "uptime", "alias", + "beep", "env", "whoami", "uptime", "alias", "unalias", "base64", "testgui" }; } @@ -936,123 +936,6 @@ namespace CMLeonOS Commands.Environment.EnvCommand.ProcessEnvCommand(args, envManager, ShowError); } - public void BackupSystem(string args) - { - string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - - if (parts.Length == 0) - { - ShowError("Error: Please specify backup name"); - ShowError("Usage: backup "); - return; - } - - string backupName = parts[0]; - string backupPath = $@"0:\backup\{backupName}"; - - try - { - Console.WriteLine($"BackupSystem: Creating backup '{backupName}'"); - Console.WriteLine($"Backup path: {backupPath}"); - - if (Directory.Exists(backupPath)) - { - ShowWarning($"Backup '{backupName}' already exists"); - ShowWarning("Returning without creating new backup"); - return; - } - - Console.WriteLine($"BackupSystem: Creating backup directory: {backupPath}"); - Directory.CreateDirectory(backupPath); - ShowSuccess($"Backup directory created"); - - // 备份系统文件 - string sysPath = @"0:\system"; - Console.WriteLine($"BackupSystem: Checking system path: {sysPath}"); - Console.WriteLine($"BackupSystem: System path exists: {Directory.Exists(sysPath)}"); - - if (Directory.Exists(sysPath)) - { - Console.WriteLine($"BackupSystem: Copying system files to backup"); - CopyDirectory(sysPath, backupPath); - Console.WriteLine($"BackupSystem: System files copied"); - } - else - { - Console.WriteLine($"BackupSystem: System path does not exist, skipping system backup"); - } - - // 备份用户文件 - string userPath = @"0:\user"; - Console.WriteLine($"BackupSystem: Checking user path: {userPath}"); - Console.WriteLine($"BackupSystem: User path exists: {Directory.Exists(userPath)}"); - - if (Directory.Exists(userPath)) - { - Console.WriteLine($"BackupSystem: Copying user files to backup"); - CopyDirectory(userPath, backupPath); - Console.WriteLine($"BackupSystem: User files copied"); - } - else - { - Console.WriteLine($"BackupSystem: User path does not exist, skipping user backup"); - } - - ShowSuccess($"Backup '{backupName}' created successfully"); - ShowSuccess($"Backup location: {backupPath}"); - } - catch (Exception ex) - { - ShowError($"Error creating backup: {ex.Message}"); - ShowError($"Exception type: {ex.GetType().Name}"); - } - } - - public void RestoreSystem(string args) - { - string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - - if (parts.Length == 0) - { - ShowError("Error: Please specify backup name"); - ShowError("Usage: restore "); - return; - } - - string backupName = parts[0]; - string backupPath = $@"0:\backup\{backupName}"; - - try - { - if (!Directory.Exists(backupPath)) - { - ShowError($"Error: Backup '{backupName}' not found"); - return; - } - - // 恢复系统文件 - string sysPath = @"0:\system"; - if (Directory.Exists(backupPath)) - { - CopyDirectory(backupPath, sysPath, true); - } - - // 恢复用户文件 - string userPath = @"0:\user"; - if (Directory.Exists(backupPath)) - { - CopyDirectory(backupPath, userPath, true); - } - - ShowSuccess($"Backup '{backupName}' restored successfully"); - ShowSuccess($"Backup location: {backupPath}"); - } - catch (Exception ex) - { - ShowError($"Error restoring backup: {ex.Message}"); - } - } - private void CopyDirectory(string sourcePath, string destPath, bool overwrite = false) { try