darkrc/bin/bak

18 lines
202 B
Text
Raw Normal View History

2020-09-02 08:35:27 +00:00
#!/bin/sh
bakrotate() {
if [ -f $1 ]
then
if [ -f "$1.bak" ]
then bakrotate "$1.bak"
fi
mv "$1" "$1.bak"
fi
}
for file in $@
do
bakrotate "$file.bak"
cp $file $file.bak
done