Remove mount share. Add config
This commit is contained in:
22
backup.sh
22
backup.sh
@@ -5,10 +5,7 @@
|
|||||||
# to install the required packages and configure the system.
|
# to install the required packages and configure the system.
|
||||||
|
|
||||||
# Specify devices and their mount points
|
# Specify devices and their mount points
|
||||||
STORAGE_DEV="sda1"
|
source config.cfg
|
||||||
STORAGE_MOUNT_POINT="/media/storage"
|
|
||||||
CARD_DEV="sdb1"
|
|
||||||
CARD_MOUNT_POINT="/media/card"
|
|
||||||
|
|
||||||
# If there is a wpa_supplicant.conf file in the root of the storage device
|
# If there is a wpa_supplicant.conf file in the root of the storage device
|
||||||
# Rename the original config file,
|
# Rename the original config file,
|
||||||
@@ -21,17 +18,6 @@ if [ -f "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" ]; then
|
|||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If there is a nfs_mount file in the root of the storage device
|
|
||||||
# Read the mount command and mount an NFS export
|
|
||||||
if [ -f "$STORAGE_MOUNT_POINT/share_mount" ]; then
|
|
||||||
sudo sh -c "echo 100 > /sys/class/leds/led0/delay_on"
|
|
||||||
MOUNT_COMMAND=$(head -n 1 "$STORAGE_MOUNT_POINT/share_mount")
|
|
||||||
sudo $MOUNT_COMMAND
|
|
||||||
SHARE_MOUNT_POINT=`echo "$MOUNT_COMMAND" cut -d" " -f5`
|
|
||||||
else
|
|
||||||
SHARE_MOUNT_POINT=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set the ACT LED to heartbeat
|
# Set the ACT LED to heartbeat
|
||||||
sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
|
sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
|
||||||
|
|
||||||
@@ -87,12 +73,6 @@ sudo lsblk > lsblk.log
|
|||||||
# Perform backup using rsync
|
# Perform backup using rsync
|
||||||
rsync -av --exclude "*.id" $CARD_MOUNT_POINT/ $BACKUP_PATH
|
rsync -av --exclude "*.id" $CARD_MOUNT_POINT/ $BACKUP_PATH
|
||||||
|
|
||||||
# If an NFS export is mounted
|
|
||||||
# Back up files to it
|
|
||||||
if [ ! -z "$SHARE_MOUNT_POINT" ]; then
|
|
||||||
rsync -av --exclude "*.id" $BACKUP_PATH/ $SHARE_MOUNT_POINT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Turn off the ACT LED to indicate that the backup is completed
|
# Turn off the ACT LED to indicate that the backup is completed
|
||||||
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
|
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user