Started writing on a tape rotate function
This commit is contained in:
parent
ff2c5ccf1f
commit
d52b980081
22
Labb5/serverbackup/taperotate.sh
Executable file
22
Labb5/serverbackup/taperotate.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Jack-Benny Persson
|
||||||
|
# LX13
|
||||||
|
# Rotate tapes
|
||||||
|
|
||||||
|
TapeFile=tape.txt
|
||||||
|
Tape=`tail -n1 $TapeFile | awk '{ print $5 }'`
|
||||||
|
HowMany=6
|
||||||
|
TimeStamp=`date "+%F %X --> "`
|
||||||
|
|
||||||
|
|
||||||
|
if [ $Tape -ge $HowMany ]; then
|
||||||
|
Tape=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
Tape=$((Tape+1))
|
||||||
|
|
||||||
|
printf "$TimeStamp Tape $Tape\n"
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user