bin/predate: add helper for backups and archives
This commit is contained in:
parent
6ee0b19f26
commit
3c34126214
|
@ -6,4 +6,4 @@ for last; do true; done
|
|||
checkaccess -w "$@" || elevate=sudo
|
||||
! $elevate test -e "$1" && echo "$1 does not exist" && exit 1
|
||||
$elevate mkdir -p $(case "$last" in (*/) echo "$last";; (*) dirname "$last";; esac)
|
||||
$elevate mv --interactive "$@"
|
||||
$elevate mv --verbose --interactive "$@"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
# Add the modification date in front of the filename
|
||||
for file
|
||||
do mv --verbose --interactive "$file" "$(stat --format %y "$file" | cut -d' ' -f1)_$file"
|
||||
done
|
Loading…
Reference in New Issue