added script to backup file
This commit is contained in:
15
debian/debian-create-backup-of-file.sh
vendored
Normal file
15
debian/debian-create-backup-of-file.sh
vendored
Normal 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
|
||||
Reference in New Issue
Block a user