added script to backup file

This commit is contained in:
2024-03-31 13:09:27 -05:00
parent 4281c9cf2d
commit 3a9f5787ed

15
debian/debian-create-backup-of-file.sh vendored Normal file
View File

@@ -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 <file to be backed up with .bak extension>"
fi
EOF
chmod +x /usr/local/bin/cpb