diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-03-30 21:58:55 -0700 |
| commit | 4acf85db722ebe7e019e7427436083b3b9f4959e (patch) | |
| tree | 6d5b416ad605730a6d573d1b4178c7676dc8a015 /scripts/lib_backup.sh | |
| parent | 89e10cd0c0331fc727889d41e34309db1fb5735f (diff) | |
| parent | e4b9059d346e6a6dbd6216cd1fb5e41085bb6e7b (diff) | |
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'scripts/lib_backup.sh')
| -rw-r--r-- | scripts/lib_backup.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/lib_backup.sh b/scripts/lib_backup.sh index 6867fb6d..b6f54f6a 100644 --- a/scripts/lib_backup.sh +++ b/scripts/lib_backup.sh @@ -1,9 +1,21 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Backup helper utilities shared by copy.sh (and future scripts). # Create a unique backup directory name with month, day, hours, and minutes. get_backup_dirname() { - echo "back-up_$(date +"%m%d_%H%M")" + if [ -n "${BACKUP_DIR:-}" ]; then + echo "$BACKUP_DIR" + return + fi + BACKUP_DIR="back-up_$(date +"%m%d_%H%M")" + export BACKUP_DIR + echo "$BACKUP_DIR" } # Move a directory to a timestamped backup alongside the original. |
