From 3a9f5787edae9c8b13234815b919a964c741c5c1 Mon Sep 17 00:00:00 2001 From: akanealw Date: Sun, 31 Mar 2024 13:09:27 -0500 Subject: [PATCH] added script to backup file --- debian/debian-create-backup-of-file.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 debian/debian-create-backup-of-file.sh diff --git a/debian/debian-create-backup-of-file.sh b/debian/debian-create-backup-of-file.sh new file mode 100644 index 0000000..af6c282 --- /dev/null +++ b/debian/debian-create-backup-of-file.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cat <<'EOF' >> /usr/local/bin/cpb +#!/bin/bash + +if [ $# -eq 1 ] +then + cp -pvi "$1" "${1}.bak" +else + echo "Info: $0 copies to a backup file" + echo "Usage: $0 " +fi +EOF + +chmod +x /usr/local/bin/cpb