Add bak script to rotate backup files

This commit is contained in:
Talia 2020-09-02 10:35:27 +02:00
parent e1daaba387
commit 601087f724

14
bin/bak Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
bakrotate() {
if [ -f $1 ]
then
if [ -f "$1.bak" ]
then bakrotate "$1.bak"
fi
mv "$1" "$1.bak"
fi
}
bakrotate "$1.bak"
cp $1 $1.bak