#!/bin/bash # copies file(s) given as argument to file.YYMMDDhhmmss if (( $# < 1 )); then echo "Usage: bk filename(s)" exit 1 fi for i in "$@"; do cp -p $i $i.$(date +%y%m%d%H%M%S) done