48 lines
1.2 KiB
Bash
Executable File
48 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if ["$1" = "-h" ]
|
|
then
|
|
echo "do-plication <option> [directory to back up]"
|
|
echo
|
|
echo "Options:"
|
|
echo
|
|
echo "-a append arcive to the back of the tape"
|
|
echo "-c checks (lists) the contents of the n'th arcive {do-plication <option> <n>"
|
|
echo "-f Override the n'th arcive {do-plication <option> <n> [directory to back up]}"
|
|
echo "-l Load the n'th arcive {do-plication <option> <n> [directory to back up]}"
|
|
echo
|
|
exit 0
|
|
fi
|
|
|
|
# Going to the right directory
|
|
# cd /media
|
|
|
|
case "$1" in
|
|
# overwrite the tape from the begining
|
|
-a)
|
|
sudo mt -f /dev/nst0 eod;
|
|
sudo mt -f /dev/nst0 status;
|
|
echo "your arcive will be the file number"
|
|
sudo screen -dmS do-plication tar -cvf /dev/nst0 "$2"
|
|
true
|
|
;;
|
|
|
|
-c)
|
|
sudo mt -f /dev/nst0 asf "$2";
|
|
sudo tar tvf /dev/st0
|
|
true
|
|
;;
|
|
|
|
-f)
|
|
sudo mt -f /dev/nst0 asf "$2";
|
|
echo "your arcive wil be $2";
|
|
sudo screen -dmS do-plication tar -cvf /dev/nst0 "$3"
|
|
true
|
|
;;
|
|
|
|
-l)
|
|
sudo mt -f /dev/nst0 asf "$2";
|
|
sudo screen -dmS do-plication tar xvf /dev/nst0 -C "$3"
|
|
true
|
|
esac
|
|
exit $? |