-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blocked out user configuration at the top of each script
- Loading branch information
Kris Hardy
committed
Oct 6, 2011
1 parent
00dc974
commit 26fc04d
Showing
5 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Amanda Toys | ||
=========== | ||
|
||
Amanda Toys is a collection of scripts and utilities that I have written in order to help me administer Amanda backup servers. | ||
|
||
They are primarily geared towards my workflow when working with hot-swap eSATA drives as "tapes". | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
Get amanda-toys by cloning the repository: :: | ||
|
||
$ git clone git://github.com/krishardy/amanda-toys.git | ||
|
||
Then add the path to your local repository to your PATH, or reference the scripts using absolute paths. | ||
|
||
|
||
Configuration | ||
------------- | ||
|
||
The scripts have some bit of configuration in them. Until I merge the configuration, open each file and look at the variable assignments in the top few lines. | ||
|
||
|
||
Contributing | ||
------------ | ||
|
||
If you like Amanda Toys, and would like to help out or send me thanks, feel free. My e-mail address is kris at rhs dot com. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
#!/bin/bash | ||
amdump $1 | ||
amcheckdump $1 | ||
|
||
###################### | ||
# USER CONFIGURATION # | ||
###################### | ||
|
||
AMPATH=/usr/sbin | ||
|
||
########################## | ||
# END USER CONFIGURATION # | ||
########################## | ||
|
||
$AMPATH/amdump $1 | ||
$AMPATH/amcheckdump $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
#!/bin/bash | ||
|
||
LABEL_PATH=/dev/disk/by-label | ||
###################### | ||
# USER CONFIGURATION # | ||
###################### | ||
|
||
DEV_LABEL_PATH=/dev/disk/by-label | ||
SLOTS_PATH=/archive/vtapes/daily/slots | ||
USER=amandabackup | ||
GROUP=disk | ||
|
||
########################## | ||
# END USER CONFIGURATION # | ||
########################## | ||
|
||
do_mount_by_label () { | ||
if [ -e "$LABEL_PATH/$1" ]; then | ||
if [ -e "$DEV_LABEL_PATH/$1" ]; then | ||
existing_mount=$(mount|grep "$SLOTS_PATH/$2") | ||
if [ "$existing_mount" != "" ]; then | ||
echo "Active mount detected: $existing_mount" | ||
echo "Continuing..." | ||
return | ||
fi | ||
sudo mount -t ext3 $LABEL_PATH/$1 $SLOTS_PATH/$2 | ||
sudo mount -t ext3 $DEV_LABEL_PATH/$1 $SLOTS_PATH/$2 | ||
if [ "$?" != "0" ]; then | ||
echo "Failed while attempting to mount $LABEL_PATH/$1 to $SLOTS_PATH/$2" | ||
echo "Failed while attempting to mount $DEV_LABEL_PATH/$1 to $SLOTS_PATH/$2" | ||
exit 1 | ||
fi | ||
sudo chown $USER.$GROUP $SLOTS_PATH/$2 | ||
if [ "$?" != "0" ]; then | ||
echo "Failed while attempting to chown $USER.$GROUP $SLOTS_PATH/$2" | ||
exit 2 | ||
fi | ||
echo "SUCCESS: Mounted $LABEL_PATH/$1 to $SLOTS_PATH/$2" | ||
echo "SUCCESS: Mounted $DEV_LABEL_PATH/$1 to $SLOTS_PATH/$2" | ||
fi | ||
} | ||
|
||
#A line like the one below will be automatically added to this script by | ||
#format-tape: | ||
#do_mount_by_label "daily-001" "slot1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters