You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/common/files/backup_rename.sh

10 lines
123 B
Bash

#!/bin/sh
set -e;
dir=$(dirname "$1");
date=$(date +%Y-%m-%d-%H-%M);
name=$(basename "$1");
mv "$1" "$dir/$date-$name";