🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Simple File Backup

by @jinwangmok

Create a timestamped backup copy of a file in the same directory. Use when the user wants to save a copy of a file before making changes.

Versionv1.0.0
Downloads699
TERMINAL
clawhub install simple-file-backup

πŸ“– About This Skill


name: file-backup version: 1.0.0 description: >- Create a timestamped backup copy of a file in the same directory. Use when the user wants to save a copy of a file before making changes. allowed-tools: Bash(cp:*) metadata: >- {"openclaw":{"emoji":"πŸ“‹","requires":{"bins":["cp","date"],"env":[]},"install":[]}}

File Backup

Create a timestamped backup copy of any file with a single command.

Usage

cp  .bak.$(date +%Y%m%d_%H%M%S)

Arguments: | # | Name | Description | |---|------|-------------| | 1 | FILE_PATH | Path to the file to back up |

Example

cp /home/user/config.yaml /home/user/config.yaml.bak.$(date +%Y%m%d_%H%M%S)

Output:

(no output on success)

The backup file is created as: ORIGINAL_NAME.bak.YYYYMMDD_HHMMSS

Example: config.yaml β†’ config.yaml.bak.20260328_143022

Success / Failure

  • Success: No output, exit code 0. Backup file created in same directory.
  • Failure: Error message from cp (exit code non-zero, e.g. file not found)
  • Verify Backup

    To confirm the backup was created:

    ls -la .bak.*
    

    πŸ’‘ Examples

    cp /home/user/config.yaml /home/user/config.yaml.bak.$(date +%Y%m%d_%H%M%S)
    

    Output:

    (no output on success)
    

    The backup file is created as: ORIGINAL_NAME.bak.YYYYMMDD_HHMMSS

    Example: config.yaml β†’ config.yaml.bak.20260328_143022