Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "backup <file>", Short: "Create a numbered backup of a file in the same directory", Long: `Create a backup of a file with format: .<basename>.<number>.<YYYY-mm-dd_HH-MM>.ext.backup Example: slu scripts backup /etc/nginx/nginx.conf Creates: /etc/nginx/.nginx.1.2025-11-05_14-30.conf.backup`, Args: cobra.ExactArgs(1), Run: func(c *cobra.Command, args []string) { filePath := args[0] backupFile, err := createBackup(filePath) if err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } fmt.Println("Backup file created:", backupFile) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.