bin: utilities for preparing backups
This commit is contained in:
parent
d8c7616eb0
commit
4fe9e9cf64
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
echo 'Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by (application name).
|
||||
# For information about cache directory tags, see:
|
||||
# https://bford.info/cachedir/'>CACHEDIR.TAG
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
# Displays the latest files in the given directory or pwd
|
||||
find "$1" -maxdepth 4 -type f -printf '%TF %f\n' | sort -r | head
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/sh
|
||||
#!/bin/sh -e
|
||||
# Add the modification date in front of the filename
|
||||
IFS='\n'
|
||||
for file
|
||||
do mv --verbose --interactive "$file" "$(stat --format %y "$file" | cut -d' ' -f1)_$file"
|
||||
do mv --verbose --interactive "$file" \
|
||||
"$(latest "$file" | head -2 | tail -1 | cut -d' ' -f1)_$(echo "$file" | sed 's/20\([0-9]\{2\}\)-\([0-9]\{2\}\)\(-[0-9]\{2\}\)\?_\?//')"
|
||||
done
|
||||
# stat --format %y "$file" | cut -d' ' -f1
|
||||
|
|
Loading…
Reference in New Issue