← 返回命令列表

Linux command

bkp 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Example

bkp [path/to/file]

Example

bkp [path/to/directory]

Example

bkp -a -m "[initial version]" [path/to/file]

Restore

bkp -r [path/to/file.b01]

Example

bkp -r -d [path/to/file.b01]

Example

bkp -i [path/to/file.b01]

Example

bkp -d [path/to/file]

Example

bkp -y [path/to/file]

说明

bkp is a Python-based command-line utility that creates sequentially numbered backups of files and directories. Running bkp on a file foo produces foo.b01, and subsequent invocations produce foo.b02, foo.b03, and so on. Backup files are always created in the same directory as the source. Two backup modes are supported. By default, bkp creates a simple file copy (or directory tree copy). With the -a flag, it produces a TAR archive that can embed metadata including the author (current user), timestamp, and an optional commit message. The -r flag restores a backup to its original name by stripping the .bNN suffix. If the original file already exists, the user is prompted for confirmation unless -y is specified. The -d flag can be combined with either backup or restore to remove the source after the operation completes. Archive metadata can be inspected with -i, which displays the author, creation time, and any message stored in the archive. Multiple paths can be specified in a single invocation, and each will be processed in sequence.

参数

-r, --restore
Restore resources from backup(s).
-d, --delete
Delete the source file or directory after the operation.
-a, --archive
Create a TAR archive instead of a simple copy.
-y, --yes
Answer yes to all confirmation prompts.
-m _TEXT_, --message _TEXT_
Message to be included in the archive metadata. Requires -a.
-M, --message-edit
Open a text editor to compose the message. Requires -a.
-i, --info
Read and display metadata from an archive backup.
--version
Print version information.
--help
Show usage information and exit.

FAQ

What is the bkp command used for?

bkp is a Python-based command-line utility that creates sequentially numbered backups of files and directories. Running bkp on a file foo produces foo.b01, and subsequent invocations produce foo.b02, foo.b03, and so on. Backup files are always created in the same directory as the source. Two backup modes are supported. By default, bkp creates a simple file copy (or directory tree copy). With the -a flag, it produces a TAR archive that can embed metadata including the author (current user), timestamp, and an optional commit message. The -r flag restores a backup to its original name by stripping the .bNN suffix. If the original file already exists, the user is prompted for confirmation unless -y is specified. The -d flag can be combined with either backup or restore to remove the source after the operation completes. Archive metadata can be inspected with -i, which displays the author, creation time, and any message stored in the archive. Multiple paths can be specified in a single invocation, and each will be processed in sequence.

How do I run a basic bkp example?

Run `bkp [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -r, --restore do in bkp?

Restore resources from backup(s).