initial commit of a *whole bunch* of old Egressive shell scripts, used to make many people redundant.
This commit is contained in:
commit
43e0f5b59e
329 changed files with 31937 additions and 0 deletions
34
egrdbackup-usb/initial.sh.example-usb
Executable file
34
egrdbackup-usb/initial.sh.example-usb
Executable file
|
@ -0,0 +1,34 @@
|
|||
#/bin/bash
|
||||
#
|
||||
# This script runs before the main rdiffbackup script
|
||||
# useful for mounting USB drives
|
||||
#
|
||||
#
|
||||
#
|
||||
POSSIBLE_USB_DRIVES="/dev/sdc1 /dev/sdd1"
|
||||
MOUNT_POINT="/mnt"
|
||||
USB_DRIVE=""
|
||||
#
|
||||
#
|
||||
for i in $POSSIBLE_USB_DRIVES
|
||||
do
|
||||
if udevinfo --query=name --name $i
|
||||
then
|
||||
USB_DRIVE=$i
|
||||
fi
|
||||
done
|
||||
if [ $USB_DRIVE"xxx" == "xxx" -o $MOUNT_POINT"xxx" == "xxx" ]
|
||||
then
|
||||
echo "ERROR - Mount point or drive device not defined in config file or drive device not found" >> $LOGFILE 2>> $LOGFILE
|
||||
fi
|
||||
#
|
||||
if ! mount | grep $USB_DRIVE > /dev/null
|
||||
then
|
||||
if ! mount $USB_DRIVE $MOUNT_POINT
|
||||
then
|
||||
echo "ERROR - Couldn't mount USB Drive" >> $LOGFILE 2>> $LOGFILE
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "WARNING - $USB_DRIVE already mounted" >> $LOGFILE 2>> $LOGFILE
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue